Yii Framework Forum: Cgridview里面 同一行 能在第二列的时候取到第一列的值嘛 - Yii Framework Forum

Jump to content

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

Cgridview里面 同一行 能在第二列的时候取到第一列的值嘛 Rate Topic: -----

#1 User is offline   straysh 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 4
  • Joined: 19-September 12

Posted 18 January 2013 - 04:59 AM

CGridView里面

同一行 能在第二列的时候取到第一列的值嘛
0

#2 User is offline   hehbhehb 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 50
  • Joined: 24-February 12

Posted 18 January 2013 - 06:50 AM

当然可以,比如 '$data->firstname.$data->lastname'
0

#3 User is offline   straysh 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 4
  • Joined: 19-September 12

Posted 18 February 2013 - 01:09 AM

我的意思是这样:

array(
'header'=>'角色',
'type'=>'raw',
'value'=>'$data["role"]',
'htmlOptions'=>array(
'style'=>'text-align:center',
'rid'=>????,
),
),

问号这里怎么写?rid 是另外一列的值 ,在$data["rid"]中
0

#4 User is offline   rootbear 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 222
  • Joined: 17-June 11

Posted 18 February 2013 - 02:15 PM

'rid'=>$model["rid"],

I enjoy the Yii.sy coding life here.
0

#5 User is offline   straysh 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 4
  • Joined: 19-September 12

Posted 22 February 2013 - 04:21 AM

View Postrootbear, on 18 February 2013 - 02:15 PM, said:

'rid'=>$model["rid"],


找到答案了,在value 上用回调函数处理
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