On Row Double Click,need a popup window

QuestionsOn Row Double Click,need a popup window
varun asked 12 years ago

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);

10 Answers
varun answered 12 years ago

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

Abu Ghufran answered 12 years ago

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.

varun answered 12 years ago

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?

Abu Ghufran answered 12 years ago

The var opts is used in the $out code (that is html+js)

Marsha answered 11 years ago

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.

Abu Ghufran answered 11 years ago

This works in latest licensed version. Free version build is little older and dont support extra params of (opts).

Marsha answered 11 years ago

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?

Abu Ghufran answered 11 years ago

$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.

Victor M. Perez answered 11 years ago

May I get this demo as well?

Abu Ghufran answered 11 years ago

Sent.

Your Answer

3 + 14 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?