Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jqGrid Cell Editing - Double Click to Edit?

By default, if a jqGrid cell is editable, single click on that cell changes it to edit mode. Is there any way I can make it edit on a double click instead? It would make it easier to do row-level operations such as deleting, as all the columns in my grid are editable.

like image 427
Kyle Avatar asked Jul 19 '10 17:07

Kyle


2 Answers

Yes, you can use the ondblClickRow event to capture a double-click.

Here is a simple example to get you started:

ondblClickRow: function(){
    var row_id = $("#grid").getGridParam('selrow');
    jQuery('#grid').editRow(row_id, true);
}
like image 182
Justin Ethier Avatar answered Nov 12 '22 04:11

Justin Ethier


I got the answer. You only need to place the code on the jqgrid properties For example:

width: 800,
        height: 200,
        caption:"   .:: Captura de Datos ::.",
        addedrow: "last",
        ondblClickRow: function (rowid, iRow,iCol) {
            alert('Doble Click');
            //jQuery("#TBLReporte").editCell(iRow, iCol, true);
        }
like image 31
Daniel Azamar Avatar answered Nov 12 '22 04:11

Daniel Azamar