konapaz
(Konapaz)
October 15, 2012, 11:50am
1
how change the max items per page in CGridView? (pagination)
also I want to change the default searching by column change the text by combobox. How I could do that?
I found related article about CGridView (http://www.yiiframework.com/doc/api/1.1/CGridView ) but I couldn’t make it.
kokomo
(Mwerlberger85)
October 15, 2012, 12:02pm
2
The IDataProvider interface, e.g. CActiveDataProvider is your friend
abennouna
(Abennouna)
October 15, 2012, 12:31pm
3
I guess you have figured by now how to change number items. (Edit: max items per page)
For this one, outside classic input field, you can set the [font="Courier New"]filter[/font] property in the relevant column to what you want. So for a combobox, you set it to a [font="Courier New"]CHtml::listData()[/font]
konapaz
(Konapaz)
October 15, 2012, 12:42pm
4
I guess you have figured by now how to change number items. (Edit: max items per page)
For this one, outside classic input field, you can set the [font="Courier New"]filter[/font] property in the relevant column to what you want. So for a combobox, you set it to a [font="Courier New"]CHtml::listData()[/font]
I never figured the number of records per page, I generated the code by gii, the default max row per page is set to 10, but I can’t find where is set.
I want to change the settings of CGridView on admin page
kokomo
(Mwerlberger85)
October 15, 2012, 1:45pm
5
You have to pass the properties/config for pagination to CActiveDataProvider. Look at the CActiveDataProvider api docu example.
alirz23
(Ali Raza)
October 17, 2012, 6:23am
6
you can do something as following
$dataProvider=new CActiveDataProvider("Model", array(
'pagination'=>array(
'pageSize'=>10,
),
));