Hi,
Please suggest me a way to add sort by on results. What i need to do is to put a sort by drop down box on top of my results . And then sort the results depending upon the option selected.
Here is the dropdown i am using:
<?php echo CHtml::dropDownList(‘sortby’,’’,array(’’ => ‘Sort By’,
'opt1' => 'option A',
'opt2' => 'option B'))
?>
But, the main issue is that i want to achieve this by ajax, i.e. i need to post the "sortby" field without refreshing the page and on the same controller/action that is listing the main results.
i tried:
<?php echo CHtml::dropDownList(‘sortby’,’’,array(’’ => ‘Sort By’,
'opt1' => 'option A',
'opt2' => 'option B'),array(
'ajax' => array(
'type' => 'POST',
'url' => CController::createUrl('project/viewbids'),
'update' =>'#searchresults'
)));
?>
But it didn’t work.
Please suggest a possible way to achieve this!
Regards,
Kul.