JqGrid prevent checkboxes from double clic event

67 Views Asked by At

I'm using a JqGrid with multiselect : true and i'm using double clic event to launch an edit function.

ondblClickRow: function (rowid) {
                var rowData = $(this).getRowData(rowid);
                document.location.href = "../record/" + rowData['id']
            },

But when it comes to select multiple rows, if you select or deselect the checkbox too quickly it launches the edit function (which I do not want).

How can I prevent the dblclick event on the checkboxes and allow it anywhere else on the rest of the row ?

1

There are 1 best solutions below

1
jcarrera On BEST ANSWER

You can do it this way:

ondblClickRow: function(rowid, iRow, iCol, e) {
   if ($(e.target).is("input")) {
       return;
   }
   var rowData = $(this).getRowData(rowid);
   document.location.href = "../record/" + rowData['id']},