I’m displaying my table data using CGridView…
I had this idea to show some not-so-important data on the mouseover of some icon using something like the overlib.js…
Soemthing like this could be usefull:
$this->widget('zii.widgets.grid.CGridView', array(
'dataProvider'=>$dataProvider,
'columns'=>array(
'id',
'name',
array(
'class'=>'CButtonColumn',
'buttons'=>array(
'imageUrl'=>'...',
'options'=>array(
'onmouseover'=>"return overlib('Timestamp:".$data->timestamp."');", // <-- !!!
'onmouseout'=>"nd();",
),
),
),
),
)); ?>
But this is not working because the htmlOption is not evaluated with the current row data…
Looking at the CButtonColumn.renderButton I think this could be implemented by changing the line
$options=isset($button['options']) ? $button['options'] : array();
to some lines calling the evaluateexpression like:
$options=array();
if(isset($button['options'])){
foreach($button['options'] as $key=>$value){
$options[$key]=$this->evaluateExpression('return '.$value,array('row'=>$row,'data'=>$data))
}
}
This way $data->attribute could be evaluated… but I’m not sure if that is the optimal solution… maybe to use it just for some options like mouseover, mouseout, …
I hope some of th edeveloper will take this in consideration