Results 1 to 2 of 2

Thread: @eval and ensureInjected with Themebuilder

  1. #1
    Sencha User
    Join Date
    Sep 2013

    Default @eval and ensureInjected with Themebuilder

    I'd like to set dynamic values in my theme, for example a backgroundcolor depending on a logged-in user preference. Is it possible to use at runtime:
    @eval userBackground com.module.UserPreferences.getUserBackground();
    and then
    with the new themebuilder?

  2. #2
    Sencha - GXT Dev Team
    Join Date
    Feb 2011


    Currently, the theme builder doesn't support custom background images other than gradients set in the configuration file. Recent work has been done on being able to provide a mechanism for custom icons.

    If the background image is a "one off," where it's only used for a panel or two, then you may want to consider just using a CSS style when constructing the widget
    If all instances of a single widget need a background image, then I can think of a couple of methods that could be considered.
    • Subclass the generated Appearance, add the background image, create a <replace-with> to override the Appearance to use new sub class.
    • When generating the theme, use the -gen flag to generate the code to a specified directory and update the code directly before jarring up.
    I just tried another option, which is fairly straight forward. By creating a CustomStyle CssResource, you can import the appearance style interface and modify. For example:

      public interface CustomResources extends ClientBundle {
        CustomStyles style();
      public interface CustomStyles extends CssResource {
    Then, in your "custom.css" file, you can change the background (I used a color in this case):

    .Css3FramedPanelStyle-body {
      background-color: green !important;
    You can then add any custom backgrounds you want.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts