Add sortby on results

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' =&gt; 'option A',


                                             'opt2' =&gt; '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' =&gt; 'option A',


                                             'opt2' =&gt; 'option B'),array(  


                        'ajax' =&gt; array(


                        'type' =&gt; 'POST',


                        'url' =&gt; CController::createUrl('project/viewbids'),


                        'update' =&gt;'#searchresults'


                         )));


                         ?&gt;

But it didn’t work.

Please suggest a possible way to achieve this!

Regards,

Kul.