Call the "Edit Form dialog"

QuestionsCall the "Edit Form dialog"
Davor Budimir asked 6 years ago

Hello Abu,

How to call the "Edit Form dialog" overside grid (like rowactions)?


5 Answers
Abu Ghufran answered 6 years ago


You can replace the Edit link functionality from jqgrid_dist.php file.

if ($this->actions["edit"] !== false)
$act_links[] = "<a title="Edit this row" href="javascript:void(0);" onclick="jQuery(this).dblclick();">Edit</a>";

Instead of jQuery(this).dblclick(); you can have

jQuery(this).jqGrid('editGridRow', cl); // where cl is row id.

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

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

<div style="margin:10px">
<?php echo $out?>

Davor Budimir answered 6 years ago

Hello Abu,

This with a double click is extremely useful option but I noticed one problem.
So when you first load the grid (and double-click on the row) "edit form" is not displayed correctly (lists the field that should not be and ignores the size of the form).

As it ignores some parameters like:

$col["show"] = array("list"=>true, "add"=>true, "edit"=>false, "view"=>true);

$grid["edit_options"] = array("recreateForm" => true, "closeAfterEdit"=>true, 'width'=>'550', 'top'=>'90', 'left'=>'100');

If you then click on the classic "edit button" things get better. Following the double-click is working properly.

Can I get instructions on how to solve this?

Best regards,

Abu Ghufran answered 6 years ago

All you need to fix is to add edit param as 3rd argument.

jQuery(this).jqGrid('editGridRow', rowid, <?php echo json_encode_jsfunc($g->options["edit_options"])?>);

Where $g is jqgrid() object.

wain answered 6 years ago

I made ​​a php function alone query and function I created will use to phpgridnya.saya not understand where do I call the function I created earlier plan to put it to continue to the next one field where I display the field'm valuenya example

Abu Ghufran answered 6 years ago

Hello Wain,

Your question is unclear. Please send your query with screenshot at [email protected].


Your Answer

4 + 2 =

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 / 5. Vote count:

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

Let us improve this post!