How To Move The Search Result To The Other Page

hello dears.

I am currently working on a project in which I want to use the Search() as just like we use with Gridview (admin view that gii generates by default.). But I want to display my search result on some other page.

here is my code.

Search code on index page.


<?php

        $this->renderPartial('_search', array(

            'model' => $model,

        ));

        ?>

        <?php

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

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

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

                            return false;

                            });

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

                            $.fn.yiiListView.update('itemslistview', {

                            data: $(this).serialize()

                            });

                            return false;

                            });

                            ");

        ?> 

and I want to display its result on the some other page e.g. search_result.php




<?php

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

                'id' => 'itemslistview',

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

                'summaryText' => '',

                'itemView' => '_products',

                'enablePagination' => false,

            ));    

?>

but it is not working.

How can I solve my problem ?

Thanks in advance.

just look at the code generated by Gii and copy it exactly in your other controller

copy everything inside actionAdmin and paste it in your actionSearchResult and copy the view files as well

take a look at the gist

https://gist.github.com/alirz23/22d2abbe02eedb8e1141

Dear I have already did the same as you have mentioned, and the search box is displaying on the index.php page. But I want that when I click on the search button then instead of displaying the search result on index page, it should be displayed on the some other page like search-result.php of which I have already share the code.

here is another gist

https://gist.github.com/alirz23/3a01365101835495c90f