Yii Renderpartial And Inlclude Css With <Link> Has A Delay

i am using yii renderPartial to load a view in to a jquery dialog. css is loaded inside the view is


Yii::app()->getClientScript()->registerCssFile(Yii::app()->baseUrl.'/css/grid.css')

also i have defined clinetscript as following with outputProcess = true.


$cs = Yii::app()->clientScript;

$cs->reset();

$cs->scriptMap = array(

    'jquery.js'  =>  false,

   'jquery.min.js'  =>  false,

);

outputProcess = true, is set in the last param.

$this->getController()->renderPartial(‘sessionGrid’, $params, false, true);

everything works fine other than the styles in rendering view (partially)…

the defined styles as mentioned above doesnt come (affect the screen) at ones but after page is rendered only it applyies and a user is able to see sudenly the changes. i.e i have a text bolded with styles but after the page is render with normal text only the bold happens and i am able to see that change which i mean as the delay.

how can i prevent this delay?

i did the same with inluding the changes done with css file on the top of view with style tag and i noticed that delay is not there.

what is causing this delay and i am thinking its because outputProcess = true. but what is the workaround to stop outProcess not letting load my css file.

this css file i am loading is not anew one and its already there in the theme it self, the reason i am including it in the above partially rendering view is, it doesnt affect due to outputProcess = true and i need to include it to get the expected look and feel in the partially rendering view.

i can get this done with writing styles inside the view via tag but its not the best way to resolve i guess. may be i am missing something.

appreciate any prompt reply.

At last i understood the issue…

when using output Process = true, yii generates an style automatically like this… gridview/styles.css

so this causes the delay as after this styles.css renders only whatever i define applies so it causes the delay.

adding this section in to particular action resolves the problem.


Yii::app()->clientScript->scriptMap['styles.css'] = false;