enableSorting no work with criteria 'order'

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.

Hi again,

I found a solution. In CActiveDataProvider instead of set ‘order’ in ‘criteria’, I had set,

		'sort'=>array(


			'defaultOrder'=>array(


				'fecha'=>CSort::SORT_DESC,


			)


		),

In this way, sorting works fine in CListView and the list of items appear sorted on the web with the criteria you want.