This is a very strange situation to me. I have a CSqldataprovider to handle my pagination.
According to documentations and examples it works almost correct. It calculates correct the number of pages based on the totalitemcount and pagesize. It shows the first page perfectly fine but when I click on the next page link it doesn't show any records. When I do var_dump on $this->dataProvider->getData() it shows an empty array on every other page than the first page...
My code for my pagination is below:
$result = Yii::app()->db->createCommand($sqlData)->queryAll();
$pages = new YMPagination(count($result));
$pages->pageSize = Yii::app()->params['itemsPerPage'];
$this->dataProvider = new CSqlDataProvider($sqlData, array(
'totalItemCount'=>count($result),
'sort'=>array(
'attributes'=>array(
'recept_id',
),
),
'pagination'=>$pages,
));
$result = $this->dataProvider->getData();
If there is someone who knows what I am doing wrong... please tell me :)
Kind regards,
Pim