help user search action !!

Hi Yii users

i am new to Yii and i would like to implement a user advanced search for a model. i inspired the code by the actionAdmin() method but i have two problems :

i would like to use POST not the GET method (i changed the code to use POST in the form action method and in

public function actionSearch()


	$model=new Ad('search');

	$model->unsetAttributes(); // clear any default values









// in the search.php view

this $(’.search-form form’).submit(function(){

$.fn.yiiListView.update('classifieds-ad-list', {


	data: $(this).serialize()


return false;


and :

$this->widget(‘zii.widgets.CListView’, array(





is this good??

in the ajax pagination when i go to next pages the search return all models in the database not only the searched models :( ?????

please i need your help

thank you

please any suggestions !!!!!

mybe this code will help u :)

// etc

if(isset($_POST['Ad']) || Yii::app()->request->isAjaxRequest){

     // etc


thank you :)