jQWidgets Forums

jQuery UI Widgets Forums General Discussions How to set a global theme for widgets to use?

Tagged: 

This topic contains 4 replies, has 4 voices, and was last updated by  Peter Stoev 11 years, 11 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author

  • efeng1983
    Member

    Hi,

    My project has introduced jqWidgets, it is very good.
    But I have a question during my using.
    Currently when I construct widgets I need to write below code:

    $(“.selector”).jqxButton({
    theme: “classic”,
    width: 80
    });

    Or

    $(“.selector”).jqxWindow({
    theme: “classic”,
    width: 420,
    showCloseButton: false,
    draggable: false,
    resizable: false
    });

    My project uses the “classic” theme all the time, but this property need to be passed into the options every time.
    I wonder is there is a global way to set the theme?
    So need time when I construct them, I need not to pass this property into the options.

    Thank you!

    Eric Feng
    2012/07/23


    Peter Stoev
    Keymaster

    Hi Eric,

    There is no global setting. However, you can write a small function which accepts 1 string parameter – the theme and set the ‘theme’ property of all widgets to point to the function’s ‘theme’ parameter.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com


    luesak
    Participant

    Hi,

    This thread is pretty old. Is there a way to set global theme yet?

    Kim


    uscore713
    Member

    Seriously, setting a global theme is a true necessity. It doesn’t matter that one can simply use a small function to return a common theme — by definition, a theme *must* be the same throughout the application.

    This can’t be difficult to quickly implement, right?


    Peter Stoev
    Keymaster

    Hi uscore713,

    It is not difficult to set a theme. You just need to set a property which is called “theme” when you initialize a widget. As you will initialize a widget, if you want to use it, I do not think that it would be a problem to set its “theme” property, too.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com/

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.