I’d like to be able to setup a default value for the CJuiWidget widget without editing the source of the widget itself or extending it.
What I’d like to achieve is to avoid to set the themeUrl settings each time I load a widget that it is based on CJuiWidget for example CJuiDialog / CJuiDatePicker and so on…
Do you know if it is possible / how do you manage this? Or do you specify the theme / themeUrl param each time you load a widget based on CJuiWidget?
for now the best solution I’ve found is to pass ‘cssFile’=>false to each widget and to include by hand my css… but in this case if I want to use a custom theme for a widget I’ll end having two css files instead of one (the one loaded by hand will then be useless as it would be overridden by the one loaded from the widget)
I 've just searched and found how to set the themeUrl for CJuidialog. I suppose it’s the same for the other JUI.
I’ve come to think now that it’s a very powerfull way to set a custom theme.
I’ve just implemented it on the farm cjuidialog_ajaxbutton under create Person. so you can have a look before implementing yourself if this answers your question.
The widget call that I make in the farm is :
'theme'=>'custom-theme', //File name must be jquery-ui.css located in 'themeUrl'/'theme'
My custom-theme was generated from the powerful JQueryUI theme Roller . Make one, download it and put it in place. Mine was "jquery-ui-1.8.1.custom.css" and I had to rename it specially to "jquery-ui.css" which seems to be expected by zii.