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,
But the HTML is not getting rendered properly. It is getting printed wrongly as,
Instead i wanted this to be printed as ,
Any help is highly appreciated!!!
Quote
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"])')
),
'class'=>'CLinkColumn',
'header'=> 'Trades',
'imageUrl' => '/images/view_all.png',
'htmlOptions'=>array('style'=>'text-align:justify'),
'linkHtmlOptions'=>array("id"=>'$data["id"]','onclick'=>'viewTrades($data["id"])')
),
But the HTML is not getting rendered properly. It is getting printed wrongly as,
Quote
<a href="javascript:void(0)" onclick="viewTrades($data['id'])" id='$data['id']'><img alt="Link" src="/images/view_all.png"></a>
Instead i wanted this to be printed as ,
Quote
<a href="javascript:void(0)" onclick="viewTrades(317)" id="317"><img alt="Link" src="/images/view_all.png"></a>
Any help is highly appreciated!!!