Hi,
I have a problem with CListView, if I set ‘order’ in the criteria of CActiveDataProvider, enableSorting no work in widget. I see the link on the web, but no sorting. If I remove the criteria ‘order’, sorting work perfect. The code:
$dataProvider=new CActiveDataProvider('Noticias', array(
'criteria'=>array(
'condition'=>'visible="S"',
'order'=>'fecha DESC',
),
And the widget:
<?php $this->widget('zii.widgets.CListView', array(
'dataProvider'=>$dataProvider,
'itemView'=>'_portada',
'sortableAttributes'=>array(
'fecha',
),
'enablePagination'=>true,
'enableSorting'=>true,
'template'=>'{sorter} {items} {pager}',
)); ?>
Any suggestion?
Pedro.