bug on filter CGridView

is there some one could tell me why if i change the paging on CGridView the filter couldn’t run propertly. it couldn’t search data although on the first it’s work. so it’s work just once. thanks before. here code that i have made :

<?php

          &#036;diagnosaM-&gt;unsetAttributes();


                    if(isset(&#036;_GET['DiagnosaM'])){


          &#036;diagnosaM-&gt;attributes = &#036;_GET['DiagnosaM'];


          }    


           &#036;this-&gt;widget('zii.widgets.grid.CGridView', array(


                 'id'=&gt;'diagnosa1-v-grid',


                 'dataProvider'=&gt;&#036;diagnosaM-&gt;search(),


                 'filter'=&gt;&#036;diagnosaM,


                 'columns'=&gt;array(


                         'diagnosa_kode',


                         'diagnosa_nama',


                         'diagnosa_namalainnya',


                         'diagnosa_katakunci',


                         'link'=&gt;array(


                               'header'=&gt;'',  


                               'type'=&gt;'raw',


                                                                                                                                                                 'value'=&gt;'CHtml::button(&quot;Pilih&quot;,array(&quot;onclick&quot;=&gt;&quot;addDiagnosa(&#092;'&#036;data-&gt;diagnosa_id&#092;',&#092;'&#036;data-&gt;diagnosa_kode&#092;',&#092;'&#036;data-&gt;diagnosa_katakunci&#092;',&#092;'&#036;data-&gt;diagnosa_nama&#092;',&#092;'&#036;data-&gt;diagnosa_namalainnya&#092;')&quot;,&quot;class&quot;=&gt;&quot;button&quot;));',





                            ),


                   )


  ));?&gt;

Bacause when you change page make an ajax call where you lost ‘DiagnosaM’ param. If you want to change dataProvider permanently see this:


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

you have to change search method on you model. and no in the view.

thanks for your attention…but

i am quite confuse…what should i do on my model?. my requirement are just filter. if i change


$diagnosaM->unsetAttributes();

      if(isset($_GET['DiagnosaM'])){

       $diagnosaM->attributes = $_GET['DiagnosaM'];

      } 



leave model as same as default from gii, filter wouldn’t work at all. could u give some example of code? thanks before.