How To Pass Variable On Linkhtmloptions

Hi

How to pass variable on linkHtmlOptions ?

‘linkHtmlOptions’=>array(‘onclick’=>‘javascript:window.open(""/CRM/default/activityListDetails",“activity_id”=>$data[\‘activity_id\’],"_blank",“width=200,height=300”)’

You can’t, set the correct url to the link itself and use:


'linkHtmlOptions'=>array('onclick'=>'javascript:window.open($(this).attr("href"),"_blank","width=200,height=300")'

Have you tried createUrl?


'linkHtmlOptions'=>array('onclick'=>'javascript:window.open(' . $this->createUrl('/CRM/default/activityListDetails', array('activity_id' => $data['activity_id'])) . ',"_blank","width=200,height=300")'

The problem is not create the url but the fact that linkHtmlOptions is set for the whole datagrid, while here is needed the record $data[‘activity_id’].

The $data variable is available in the urlExpression but not in the linkHtmlOptions.

So the solution here is to set the correct url to the link and get it with jquery

Thanks zaccaria

I didn’t even realize the thread was for CLinkColumn