Hi Abu,
Few Questions
1.Can u plz let me know weather is it possible to create a popup window on any row double click,And the
2. since i need a selectedRow for PopUp:
e["jsonselectrow"] = "doonselect";
…
grid- set events(e);
is not working for me so,can you just let me know how to write a simple alert from JS code on selectedRow.click event either using my Custom Code below.
custom = CUSTOM
("gridid").click(function query()
{
var selr = jQuery('gridid').jqGrid('getGridParam','selrow');
var Col1=jQuery('gridid').jqGrid('getCell',selr,'ClientID');
var Col2=jQuery('gridid').jqGrid('getCell',selr,'ServiceID');
if(selr)
{
var newwin=window.alert(hi);
}
else
alert("No selected row");
return false;
});
CUSTOM;
grid-setJSCode(custom);
while posting question,invalid characters stopped me from inserting exact code,let me knw is it possible to config the CUSTOM code and make a popup on selectedRow.click event
Check this FAQ
##### Q) How to show "Edit Record" dialog on row double click?
Following code snippet will enable edit dialog on row double click. This will be placed in before we echo $out variable.
<script>
var opts = {
'ondblClickRow': function (id) {
var rowid = jQuery(this).jqGrid('getGridParam','selrow'); // returns null if no row is selected (single row)
jQuery(this).jqGrid('editGridRow', rowid);
}
};
</script>
…
<div style="margin:10px">
<?php echo $out?>
</div>
You can have your js code inside that ondblclick function.
and i would be pleased to know where the variable opts is called,since you are calling a direct function. do i need to echo opts,if yes where?
Hi Varun
Did you get the function worked? I've tried to copy the code to my html page that contains the phpgrid, but nothing's happen.
This works in latest licensed version. Free version build is little older and dont support extra params of (opts).
I did buy the phpGrid Enterprise version. I just need to put the var opts javascript in my html code that contains the phpgrid right? And what is the purpose of the $out code?
$opts variable definition is placed before echo $out.
The $out will render all related JS code to display grid.
I am sending you a demo on email.