Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In jqGrid, can you double click a row to bring up the edit form?

Tags:

jquery

jqgrid

In this demo of jqGrid, when you click on the "Edit Selected Row" button:

enter image description here

it brings up an edit form.

enter image description here

Is there any way to double click on a row in the grid to bring up this same edit form?

like image 673
leora Avatar asked Feb 13 '11 05:02

leora


People also ask

How do I add edit and delete button for jqGrid for every row?

Mention editLink and deleteLink in colModel name of edit and delete for display Edit and Delete button in jqgrid for each row. Show activity on this post. I got it, Just take additional column, and add formaater actions as model class. That's it.

How do I highlight a row in jqGrid?

If the row which you need highlight has the id 123 you can just use setSelection method for selecting: jQuery('#tab_Categorize'). jqGrid('setSelection', '123');

What is rowNum in jqGrid?

jqGrid exposes a property rowNum where you can set the number of rows to display for each page.


2 Answers

It can be very simple implemented as

ondblClickRow: function(rowid) {
    jQuery(this).jqGrid('editGridRow', rowid);
}

you can also use any additional properties of editGridRow described in the documentation. For example

ondblClickRow: function(rowid) {
    jQuery(this).jqGrid('editGridRow', rowid,
                        {recreateForm:true,closeAfterEdit:true,
                         closeOnEscape:true,reloadAfterSubmit:false});
}
like image 199
Oleg Avatar answered Oct 03 '22 00:10

Oleg


simple way

ondblClickRow : function(rowid) {
    $("#edit_mygridId").trigger("click");
}
like image 27
Bashmakov Evgeniy Avatar answered Oct 03 '22 00:10

Bashmakov Evgeniy