I have the following code, and when a button is clicked i would like to change the dataProvider… how can i do this with JQuery?
$this->widget('zii.widgets.CListView', array(
'dataProvider'=>$inboxMessages,
'template'=>"{items}\n{pager}",
'itemView'=>'_messageView',
'id'=>'listMessages',
));
You should be able to use the yiiListView.update js helper function to do what you want. You would just need to put a conditional before you create the widget to determine the data provider, e.g.:
Then create a button with a click event like:
You can look here for more info or search for yiilistview.js examples.