how to save searches in CGridView

How to save the search results of a model into another model ?

I have this at the view file





<?php

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

$('.search-button').click(function(){

	$('.search-form').toggle();

	return false;

});

$('.search-form form').submit(function(){

	$.fn.yiiGridView.update('wsrecruitcvhead-grid', {

		data: $(this).serialize()

	});

	return false;

});

");

?>


<?php echo CHtml::link('Advanced Search','#',array('class'=>'search-button')); ?>

<div class="search-form" style="display:none">

<?php $this->renderPartial('_search',array(

	'model'=>$model,

)); ?>

</div><!-- search-form -->

<?php echo " | " .CHtml::link('Save Search',array('savesearchresult','r'=>'wsrecruitcvhead/savesearchresult')); ?>


<?php $this->widget('zii.widgets.grid.CGridView', array(

	'id'=>'wsrecruitcvhead-grid',

	'dataProvider'=>$model->search(),

	#'filter'=>$model,

	'columns'=>array(

		#'MemberShipID',

		#'ResumeID',

		'ResumeTitle',

		'ResumeSummaryIntroduction',

		'Name',

		'DOB',

                array(

                    'class' => 'CButtonColumn',

                    'viewButtonUrl' => 'Yii::app()->createUrl("wsrecruitcvhead/view",array("id"=>$data["ResumeID"]))',

                    'template'=>'{view}',

                ),

	),

)); ?>



how will I get the id values of each magnifying glass icon from the search result ?

I have this in my controller




        /*

         * CV advance search page

         */

        public function actionAdvancecvsearch()

        {


            $model = new Wsrecruitcvhead('search');

            $model->unsetAttributes();

            if(isset($_GET['Wsrecruitcvhead']))

                $model->attributes = $_GET['Wsrecruitcvhead'];

                $this->render('advancecvsearch',array(

                    'model' => $model,

                ));

            

        }


        /*

         * save search results

         */

        public function actionSavesearchresult()

        {

            $model = new Wsrecruitsavedsearches;

            if(isset($_POST['Wsrecruitcvhead']))

            {

                $model->MemberShipID = Yii::app()->user->id;

                $model->ResumeID = $_POS['Wsrecruitcvhead']['id'];

                $model->datesaved = new CDbCriteria(NOW());

                if($model->save())

                {

                    $this->redirect(array('savedcvsearches','r'=>'wsrecruitcvhead/savedcvsearches'));

                }

                else

                {

                    $this->redirect(array('advancecvsearch','r'=>'wsrecruitcvhead/advancecvsearch'));

                }

            }

        }


        /*

         * render savedcvsearches

         */

        public function actionSavedcvsearches()

        {

            //some code stuff here

            $this->render('savedcvsearches');

        }



actually I saw a sample similar to my problem

http://www.yiiframework.com/forum/index.php?/topic/13297-solved-save-cgridview-search-results/

but it didn’t helped

hi, am still stuck, is there anyone who can tell me how to get the values of the search results

so that when I click the save search link, it’ll save the ID