Theme sometimes not rendered in CJuiWidgets

Hello, everyone. I’m getting problems regarding the layout of my CJuiWidgets. Their corresponding CSSes or themes don’t render when I call them, whether I insert a new data or update an existing one. Though, in some instances, the css works. Is it because of the URL? Here are some of my codes in my config/main:




'widgetFactory'=>array(

     'widgets'=>array(              	

             'CJuiDialog'=>array(

                    'themeUrl' =>Yii::app()->request->baseUrl.'../../css',

                    'theme' => 'nps_theme',

                	'cssFile'=>'jquery-ui.css',

	     ),

             'CJuiButton'=>array(

                    'themeUrl' =>Yii::app()->request->baseUrl.'../../css',

                    'theme' => 'nps_theme',

                	'cssFile'=>'jquery-ui.css',

	     ),


             //I have a separate cssFile for GridView

             'CGridView'=>array(

                    'cssFile'=>Yii::app()->request->baseUrl.'../../css/widgets/gridview/styles.css',

             

	     ),

     )

)



I know this Yii::app()->request->baseUrl.’../../css’ doesn’t look right. There are no dots and slashes (../../) because it already points to the specific folder. Or I’m just wrong? Please enlighten me.

Any good souls?

have a look at this -

http://www.yiiframework.com/wiki/107/theming-your-zii-widgets/

so maybe in your case, try this -

‘themeUrl’ =>Yii::app()->request->basePath.’/../../css’,

Yes! That’s how I made my theme working, but my problem now is how to render the same theme when I create/update fields in a table using CJuiDialog.

This is how my CJuiDialog looks now:

How it should look:

About the URL, it’s already my default one since removing the dots and slashes causes problems in rendering the page.

Any ideas, sir?

Anyone?

Hi Ramione!

How many themes do you have for your project? If you only have one theme, might as well include the theme as part of the <header> tag of your main layout. Otherwise, what you can do is to use firebug to see which css style are affecting your widgets.

Yes! That solved it. Ugh. I’m so stupid to not realize it on the first place. I thought setting up the config file would fix it. Thanks though! :D