CSqlDataProvider pagination problem cgridview

Hi guys.

I´m using CSqlDataProvider to populate my cgridview. That´s my code:




$dataProvider=new CSqlDataProvider($sql,array('pagination'=>array(

       		 'pageSize'=>3,

    	)));



That´s my grid:




$this->widget('zii.widgets.grid.CGridView', array(

		'dataProvider'=>$dados_grid,

		'summaryText'=>'',

		

		'ajaxUpdate'=>true,

		'columns'=>array(

			 array(

			 	 'header'=>'Data de Registro',

				 'name'=>'data_escala',

				 

			 ),

			 array

			 (

			 	'header'=>'Inconsistência',

			         'name'=>'inconsistencia',

			 )

			

		),

	));	




And that´s my view:




<div id="grid_inconsistencia">

    	<?php $this->renderPartial('grid_inconsistencia',array('dados_grid'=>$dados_grid));?>

    

</div>



Note: That´s div is a jquery dialog

The pagination works but don´t show the pagination buttons and i don´t know why. Someone can help me?

Thanks!

Follows a screenshot to demonstrate the problem.

See the class reference here:

http://www.yiiframework.com/doc/api/1.1/CSqlDataProvider

In short: You need to supply the “totalItemCount” property with a count of the data you’re fetching.

Thank you very much Lily, worked beautifully.