Hi Comunity,
I’ve a default sort problem in a cgridview, when it shows the fisrt time the sorting does in ‘desc’ not in ‘asc’ order in the atributte ‘rif’ which is the first cgridview’s column, following is the code in the model from search method:
what I’am doing wrong, thanks in advance
$sort = new CSort();
$sort->defaultOrder=array(
'rif'=> array(
'asc'=>'CONCAT(nacionalidad, rif) ASC',
'desc' => 'CONCAT(nacionalidad, rif) DESC',
'default' => 'asc',
));
$sort->attributes = array(
'nombre_cliente'=>array(
'asc'=>'nombre_cliente ASC',
'desc'=>'nombre_cliente DESC',
),
'rif'=> array(
'asc'=>'CONCAT(nacionalidad, rif)ASC',
'desc' => 'CONCAT(nacionalidad, rif) DESC',
'default'=>'asc',
),
'*', // add all of the other columns as sortable
);
return new CActiveDataProvider($this, array(
'criteria'=>$criteria,
'sort'=>$sort,
'pagination' => array(
'pageSize' => 10,
),
));