Search In Grid View

hi all,

i displayed my content from table using gridview as below ,but

the column i had displayed was not from the corresponding model .the thing i have to do is search for that column which was added newly from another model ,how can i proceed with?

$data->user->NAME was taken from another model ,i have to do search for that column in the current model ,help me please

thanks in advance :rolleyes:

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

'id'=&gt;'grid',


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


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


'columns'=&gt;array(


            array(


                'header'=&gt;'Serial Num',


                'value'=&gt;'&#036;row+1',


            ),


            [b]array(


                'header'=&gt;'Name',


                'value'=&gt;'&#036;data-&gt;user-&gt;NAME',


            ),[/b]


            'Hobby',


	'Interest',


           


       


	array(


		'class'=&gt;'CButtonColumn',


	),


),

)); ?>

Hi, you can check the wiki:

http://www.yiiframework.com/wiki/281/searching-and-sorting-by-related-model-in-cgridview

Thanks a lot, done! :)