jQuery in CGridView
I am trying to get a CJuiDialogBox on clicking an ajaxLink on a gridView. for that I have to creat the ajaxLink inside the cGridView. I am stuck on the onclick line, there I want to render quotes around the component id. But it is not getting done.
'value' => 'CHtml::ajaxLink("Link",
Yii::app()->createUrl("Administrator/settings/edit", array("module"=>$data["module"])),
array(
"onclick" => "$(\"#juiDialog\").dialog(\"open\"); return false;",
// "update" => "开发者_C百科#juiDialog"
),
array("id" => "aLink_" . $data["module"])
)'
What I get in browser source is
{'onclick':'$(\"#juiDialog\").dialog(\"open\"); return false;'
What I look for is
{'onclick':'$("#juiDialog").dialog("open"); return false;'
Did you try just using single quotes for the onclick attribute like:
"onclick" => '$("#juiDialog").dialog("open"); return false;',
精彩评论