Can anyone point me to an example of a CGridView with sortable columns? I have set the columns sortable and the enableSorting flag to true. I think I need to specify a 'sort' condition in the relevant controller as well, but I can't figure out the syntax.
Thanks in advance.
Page 1 of 1
CGridView Sort?
#2
Posted 28 February 2010 - 02:53 AM
queej, on 27 February 2010 - 11:42 PM, said:
Can anyone point me to an example of a CGridView with sortable columns? I have set the columns sortable and the enableSorting flag to true. I think I need to specify a 'sort' condition in the relevant controller as well, but I can't figure out the syntax.
Thanks in advance.
Thanks in advance.
try:
$dataProvider=new CActiveDataProvider('model', array(
'criteria'=>array(something here),
'sort'=>array('item1','item2','item3'),//here is your deal
'pagination'=>array(
'pageSize'=>self::PAGE_SIZE,
),
)best,
bettor
Share this topic:
Page 1 of 1

Help













