1. #1
    Sencha Premium Member
    Join Date
    May 2011
    Posts
    8
    Vote Rating
    1
    andap is on a distinguished road

      0  

    Default Answered: Setting a theme

    Answered: Setting a theme


    Hello,

    From what I read, the setting of the theme for an application is done only in the Entrypoint class. I tried setting it in other places, but it had no effect.

    Is there any way I can set it somewhere else except the Entrypoint? Because I am loading some user preferences and the loading does not take place in the Entrypoint.

    Thanks in advance,

    Anda

  2. Hi.

    I use a menu for setting the style. The styles can be changed at any time.
    This is how I do the chage:

    PHP Code:
    CSS.removeStyleSheet("gxt_theme");
    CSS.addStyleSheet("gxt_theme"newThemeUrl); 
    Where newThemeUrl contains the path to one of the gxt css files (gxt-all.css, gxt-gray.css, or xtheme-slate.css, for example).

  3. #2
    Sencha User
    Join Date
    Nov 2008
    Location
    Vienna - Austria
    Posts
    870
    Vote Rating
    1
    Answers
    9
    micgala is on a distinguished road

      0  

    Default


    Hi.

    I use a menu for setting the style. The styles can be changed at any time.
    This is how I do the chage:

    PHP Code:
    CSS.removeStyleSheet("gxt_theme");
    CSS.addStyleSheet("gxt_theme"newThemeUrl); 
    Where newThemeUrl contains the path to one of the gxt css files (gxt-all.css, gxt-gray.css, or xtheme-slate.css, for example).

  4. #3
    Sencha Premium Member
    Join Date
    May 2011
    Posts
    8
    Vote Rating
    1
    andap is on a distinguished road

      0  

    Default


    Hi,

    Thank you for the answer, but I was looking for a Java code sample for this.

  5. #4
    Sencha User
    Join Date
    Nov 2008
    Location
    Vienna - Austria
    Posts
    870
    Vote Rating
    1
    Answers
    9
    micgala is on a distinguished road

      0  

    Default


    That is exactly what I pasted you...
    CSS is a GXT class.

    Regards,
    Michel.

  6. #5
    Sencha Premium Member
    Join Date
    May 2011
    Posts
    8
    Vote Rating
    1
    andap is on a distinguished road

      0  

    Default


    Yes, you are right, it is a GWT class. But now my question would be: how to link the "id" that has to be passed to the remove and add stylesheet methods to the actual path of the .css file? I see that the add method has a url in its parameter list, but how does the remove know what to remove?

    Thanks in advance

  7. #6
    Sencha User
    Join Date
    Nov 2008
    Location
    Vienna - Austria
    Posts
    870
    Vote Rating
    1
    Answers
    9
    micgala is on a distinguished road

      0  

    Default


    "gxt_theme" is the id used by gxt... so simply stick with that.
    Removing the style "gxt_theme" will remove the current theme.
    Simply then add the new one using also that id.

Thread Participants: 1

Tags for this Thread