Hello, is it possible to add some JS to a checkbox col to open a URL? So far I have the following which works great on text but doesn't work on checkbox..
http://hastebin.com/iperohageg.php
Thank you
When clicked on checkbox, it will open a link if checked.
http://hastebin.com/oxadeziviq.php
Hi there, thank you that does indeed open the window but doesn't pull through the variable..
It returns
http://localhost/live_portal/library/leademail.php/?id={client_id}
where the text link option I posted in hastebin returns
http://localhost/live_portal/library/leademail.php/?id=5
Regards
Gary
Set js callback function with onclick
$col = array();
$col["title"] = "Closed";
$col["name"] = "closed";
$col["width"] = "50";
$col["editable"] = true;
$col["edittype"] = "checkbox"; // render as checkbox
$col["editoptions"] = array("value"=>"Yes:No"); // with these values "checked_value:unchecked_value"
$col["editoptions"]["onclick"] = 'send_email(this)';
$cols[] = $col;
and in html code …
<script>
function send_email(o)
{
// get row id
var rowid = jQuery('#list1').jqGrid('getGridParam','selrow');
if (o.checked)
window.open("http://localhost/live_portal/library/leademail.php/?id="+rowid,"newwind","height=200,width=550");
}
</script>
Complete code here: http://pastebin.com/Vdu0ykpM