btilley
(Btilley)
1
Hello everyone. I am attempting to assign an id to one of my CbuttonColumn icons with the following code:
'details'=>array(
'label'=>'View Details',
'imageUrl'=>Yii::app()->request->baseUrl.'/images/icons/16x16/details.png',
'url'=> 'Yii::app()->createUrl("linesWln/view", array ("id"=>$data->id))',
'options'=>array('class'=>'colorbox_details','id'=>'$data->id')
),
However when I look at the source code created by yii, it actually creates:
[html]id="$data->id"[/html]
Instead of the actual id from the database.
Any ideas?
rootbear
(Alex Xm)
2
try:
'details'=>array(
'label'=>'View Details',
'type'='raw',
//~~~
),
ref:here
btilley
(Btilley)
3
Thanks rootbear for the suggestion. I tried adding:
'type'=>'raw'
but the id is still getting declared in the source as:
[html]id="$data->id"[/html]
btilley
(Btilley)
5
I get the following stack trace error:
Undefined variable: data
rootbear
(Alex Xm)
6
wait a minute,should it be htmlOptions?
'details'=>array(
'label'=>'View Details',
'imageUrl'=>Yii::app()->request->baseUrl.'/images/icons/16x16/details.png',
'url'=> 'Yii::app()->createUrl("linesWln/view", array ("id"=>$data->id))',
'htmlOptions'=>array('class'=>'colorbox_details','id'=>'$data->id')
),
btilley
(Btilley)
7
Thanks again rootbear. I initially tried the htmlOptions, and it have no effect on the button. Did not even assign it the class or id.
btilley
(Btilley)
8
Any other ideas? Thank you again for your help.