How to edit selected cell on jqGrid

I use inline editing with jqGrid, but when I select a cell, the cursor is positioned in the first column of the row, but I would like to know if there is a way to edit the current cell that I clicked instead of the first row.

Thanks in advance.

+6
source share
1 answer

A very good point!

I personally prefer to use the ondblClickRow event handler to trigger edit mode. So you can use the oneditfunc editRow parameter:

 ondblClickRow: function(rowid,iRow,iCol,e) { grid.jqGrid('editRow',rowid,true,function(){ $("input, select",e.target).focus(); }); return; } 

or just put the code that sets focus after calling editRow :

 ondblClickRow: function(rowid,iRow,iCol,e) { grid.jqGrid('editRow',rowid,true); $("input, select",e.target).focus(); return; } 

See the corresponding demo here .

+6
source

Source: https://habr.com/ru/post/891736/


All Articles