sorting - Yii CGridView - Sort by DESC first on column header click -


is possible change order of column-header click sort?

i have "ranking" column, upon first click sort asc, , on 2nd click go desc sort - need reverse 1st click desc, , 2nd click asc.

is possible?

return new csqldataprovider($sql . $search, array(             'totalitemcount' => $itemcount,             'params' => $params,             'sort' => array(                 'attributes' => array (                     'enabled',                     'store_name',                     'rating' => array (                         'desc' => 'rating * percent / 100 desc',                         'asc' => 'rating * percent / 100 asc',                     ),                 ),                 'defaultorder' => array( 'store_name'=>false )             ),             'pagination' => array('pagesize' => yii::app()->user->getstate('pagesize_cs', yii::app()->params['defaultpagesize']),),         )); 

the way know of hack results in column arrows pointing wrong way.

'desc' => 'rating * percent / 100 asc', 'asc' => 'rating * percent / 100 desc', 

Comments

Popular posts from this blog

javascript - Count length of each class -

What design pattern is this code in Javascript? -

hadoop - Restrict secondarynamenode to be installed and run on any other node in the cluster -