ajax pagination doesnt work

I have the following code in the view, but when I click page 2, the whole webpage is refreshed. Why?




<?php $this->widget('zii.widgets.CListView', array(

	'dataProvider'=>$pd,

	'ajaxUpdate' => true,

	'itemView'=>'_item',

)); ?>



Hi aslan,

Normally you don’t have to set ‘ajaxUpdate’ property. The default value of null should do the ajax updating as you expect.




<?php $this->widget('zii.widgets.CListView', array(

	'dataProvider'=>$pd,

//	'ajaxUpdate' => true,

	'itemView'=>'_item',

)); ?>



http://www.yiiframework.com/doc/api/1.1/CListView#ajaxUpdate-detail

  • null (default) : normal ajax updating

  • false : non ajax updating

  • comma separated ID strings : specifying the additional elements that should be updated together with the list by ajax updating

Your “‘ajaxUpdate’ => true” should have confused the CListView.

Hi thanks. but whether i set ‘ajaxUpdate’ property or not, this clistview is always NOT in the ajax mode. I can see the link in the address bar of the browser as ‘xxxindex.php/module/3?concept_id_page=2’, and then the whole page is refreshed. I am really confused!

I see.

Isn’t there any javascript error in the page? Even if it has nothing to do with CListView, any error in the javascript will suppress the ajax.