I'm working on a Yii application in which in some part of it I need to use a CGridView to show some database records.My aim is to update it's result by an ajax call(based on some filters on table columns) but the problem is in each call CGridView establishes a new get request for getting it's related jquery files and this causes increasing my website loading time.
Is there any way to tell CgridView to get these files only one time in the first ajax request?
how can I stop it from getting these files several times?
Use scriptMap to prevent loading of jquery files in your ajax call.
Yii::app()->clientScript->scriptMap=array(
'jquery.js'=>false,
'jquery.ba-bbq.js'=>false,
'jquery.yiigridview.js'=>false
);
You can get or load js file externally, you can found your answer here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With