Yii Framework Forum: Ajax pagination not working if key field is not id for CarrayDataProvider and CListView - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Ajax pagination not working if key field is not id for CarrayDataProvider and CListView Rate Topic: -----

#1 User is offline   jiaming 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 262
  • Joined: 10-April 12

Posted 24 July 2012 - 05:30 AM

Dear all,

I am using CarrayDataProvider and CListView to display datas now. But I found the ajax pagination is not working when I add
    'keyField'=>'questions_id',

.


Here is one of my dataproviders ...I have same codes for another data provider, this one is only different with
    'keyField'=>'questions_id',
.

And AJAX is not woking anymore.... Thanks so much! :D

in my View:
$this->widget('zii.widgets.CListView', array(
             'dataProvider'=>$questionsDataProvider,
             'itemView'=>'_questionsview',
             'pagerCssClass'=>'right',
             'template'=>'{items}{pager}',
              'ajaxUpdate'=>true,
));



In my Controller:

    $questions=QuestionsEmail::model()->findAllByAttributes(array('user_id'=>$user->id));
     $questionsDataProvider=new CArrayDataProvider($questions,array(
    'pagination'=>array(
        'pageSize'=>5,
    ),
    'keyField'=>'questions_id',
));



Everything should be fine...but AJAX is not working... No ajax request submitted...when you click on the pager, a new url address will be generated...

No errors in firebugs...also

Thanks!!!
0

#2 User is offline   aslan 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 71
  • Joined: 02-April 12

Posted 02 September 2012 - 06:32 PM

Hi, I got the same problem. Any solutions, please?
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users