I'm new to YII framework, I wanted to create a link column having a image. Clicking image should call a Javascript function, PHP values need to be passed to that javascript function. here is the code,
<pre>
array(
'class'=>'CLinkColumn',
'header'=> 'Trades',
'imageUrl' => '/images/view_all.png',
'htmlOptions'=>array('style'=>'text-align:justify'),
'linkHtmlOptions'=>array("id"=>'$data["id"]','onclick'=>'viewTrades($data["id"])')
),
</pre>
But the HTML is not getting rendered properly. It is getting printed wrongly as,
<pre>
<a href="javascript:void(0)" onclick="viewTrades($data['id'])" id='$data['id']'><img alt="Link" src="/images/view_all.png"></a>
</pre>
Instead i wanted this to be printed as ,
<a href="javascript:void(0)" onclick="viewTrades(317)" id="317"><img alt="Link" src="/images/view_all.png"></a>
Any help is highly appreciated!!!