Yii Framework Forum: Search In Grid View - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Search In Grid View Rate Topic: -----

#1 User is offline   Aadhira 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 28
  • Joined: 06-February 13

Posted 13 February 2013 - 02:58 AM

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'=>'grid',
'dataProvider'=>$model->search(),
'filter'=>$model,
'columns'=>array(
array(
'header'=>'Serial Num',
'value'=>'$row+1',
),
array(
'header'=>'Name',
'value'=>'$data->user->NAME',
),

'Hobby',
'Interest',


array(
'class'=>'CButtonColumn',
),
),
)); ?>
0

#2 User is offline   ragua 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 131
  • Joined: 23-January 12
  • Location:Paris - France

Posted 13 February 2013 - 03:31 AM

Hi, you can check the wiki:
http://www.yiiframew...el-in-cgridview
0

#3 User is offline   Aadhira 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 28
  • Joined: 06-February 13

Posted 13 February 2013 - 04:13 AM

View Postragua, on 13 February 2013 - 03:31 AM, said:

Hi, you can check the wiki:
http://www.yiiframew...el-in-cgridview



Thanks a lot, done! :)
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users