I want to order search results by using some sort of ajax functions.
For example,
When a user types <bla> into the search textbox and hits the search button, a new page (actionView) displays all items that match the search criteria. (This part works.)
But lower down in the screen there is a dropDownList where you can change the order on how these are displayed.
So far I have (controller)
public function actionView($id)
$criteria=new CDbCriteria(array(
'condition'=>'person_id='.$id,
'order'=>$order,
));
$dataProvider=new CActiveDataProvider('Sugestion', array(
'pagination'=>array(
'pageSize'=>20,
),
'criteria'=>$criteria,
));
view.php has
<?php
$form=$this->beginWidget('CActiveForm', array(
'action'=>Yii::app()->createUrl($this->route),
'method'=>'post',
));
echo CHtml::dropDownList('orden', $select,
array('Priority' => 'Priority', 'Date' => 'Date', ));
$this->endWidget();
...
$this->widget('zii.widgets.CListView', array(
'dataProvider'=>$dataProvider,
'itemView'=>'_view',
)); ?>
?>
I have no idea on how to just send (though Ajax I imagine) the dropDownList item selected and just refresh the CListView.
Thanks in advance