Reputation: 4342
i have a CgridView thats being loaded on ajax inside a modal, i want the pagers and filters to update the data via ajax (for now is just making an url request which changes the page to the url that only shows the cgridview). I know the widget has ajaxUpdate property but i don't know how to use it and i'm not sure if what i'm looking is what the property can do.
the widget:
$this->widget('zii.widgets.grid.CGridView', array(
'id'=>'champions-grid',
'dataProvider'=>$dataProvider,
'itemsCssClass'=>'table',
'columns'=>array(
'Name',
'AttackDamage',
'AttackSpeed',
),
));
Update: I found out this widget uses it's own javascript library, but as it is being loaded via ajax (sorry for not to mention it earlier), the javascript is not loaded, however i know this won't tell how to make updates via ajax, i just thought i had to write this down here.
Upvotes: 1
Views: 1265
Reputation: 496
you would need to add
'ajaxUpdate'=>true,
So that code should look like
$this->widget('zii.widgets.grid.CGridView', array(
'id'=>'champions-grid',
'dataProvider'=>$dataProvider,
'ajaxUpdate'=>true,
'itemsCssClass'=>'table',
'columns'=>array(
'Name',
'AttackDamage',
'AttackSpeed',
),
));
Upvotes: 1