Dynamically Update A Clistview With Multiple Condition

hi,

How to filter the search results as a combination of checkboxes and dropdown in Yii? I have some categories as checkboxes and budget as dropdown that is listing from database. WIth multiple checkboxes checked and selecting a value from dropdown, how can I filter out the search results… Is there any better way ?? (My requirement is like in this link. http://www.ebay.in/sch/i.html?_from=R40&_sacat=0&_nkw=pendrives&rt=nc&LH_FS=1 )

When you select the value from dropdownlist, You will get single value.

When you select the multiple checkboxes, you will get array and you have to apply [ex] "ID IN (arrayvalues)" Condition.

CDbCriteria will helpful to handle multiple condition.

Iam using javascript for updating the CListview,


 <?php

Yii::app()->clientScript->registerScript('status', '

$(".status").change(function(){

        $.fn.yiiListView.update("request-list",{data:{status:$(this).val()}});    

        });

');

Yii::app()->clientScript->registerScript('maximum', '

$("#maximum").change(function(){

        $.fn.yiiListView.update("request-list",{data:{maximum:$(this).val(),minimum:$(this).val()}});     

        });

');

Yii::app()->clientScript->registerScript('minimum', '

$("#minimum").change(function(){

        $.fn.yiiListView.update("request-list",{data:{minimum:$(this).val()}});     

        });

');


Yii::app()->clientScript->registerScript('category', "

$('.categoryFilter').change(function(){

 $.fn.yiiListView.update("request_list",{data:{category:$(this).val()}});

        

        });


');

  }

but it is not working in multiple conition

here for multiple condition

// categoryFilter is class of fields

$(’.categoryFilter’).change(function(){

categorys = &#036;('.categoryFilter').serialize();


&#036;.fn.yiiListView.update(


    'caregiverlistview',


    {data: categorys}


);

});

hope this help… :)