Hi there,
I am using a CJuiTabs to implement a settings page on one of my projects and I have set it to load the tab content via ajax.
Something along the following lines:
- In the page view I render the CJuiTabs
$this->widget('CJuiTabs',array(
'id'=>'back-office-tabs',
'tabs'=>array(
'Settings'=>array(
'id'=>'settings',
'ajax'=>$this->createUrl('site/settings'),
),
),
'options'=>array(
'cache'=>true,
),
));
- In the ‘site/settings’ action I render a view partially
$this->renderPartial('_settings',array(),false,true);
- In the view I render a CGridView widget
$this->widget('CGridView',array(
'id'=>'settings-grid',
'dataProvider'=>new CActiveDataProvider('Settings',array(
'sort'=>array('defaultOrder'=>'name'),
)),
'columns'=>array(
'name::Name',
'value::Value',
),
));
It works perfectly. However, now that I want to deploy the app, I used a custom AssetManager to retrieve assets from a CDN (Amazon’s CloudFront). Basically, it prepends the CDN url to the asset url published by CAssetManager and independently I copied the contents of the public/assets folder to the CDN.
I have compared the HTML code generated by the app using both CAssetManager and my custom AssetManager and, as expected, they are exactly the same, except for the references to the CSS/JS and other resource files that are hosted in the CDN.
Therefore:
1- the asset links are rewritten properly and are refering to the proper asset files in the CDN;
2- the CDN contents match exactly the structure and contents of the public/assets folder;
Now the funny thing: I am getting a JavaScript error when executing the app using the custom AssetManager
“Uncaught TypeError: Object [object Object] has no method ‘yiiGridView’”
Both apps are running under HTTPS.
Except for this particular page, the rest of the app works great using the custom AssetManager.
Does anyone has any clue about what might be going wrong here?
Thanks!