JqGrid - prevent row deselection

Using jqGrid, if I click the selected row again, the row will not be selected.

Is there any way to prevent this? I would like the row still to be selected.

+2
source share
2 answers

Here is a workaround that my brother and I came up with, just put the following code in the beforeSelectRow event:

  beforeSelectRow: function(rowid, e) {
      if ($(this).getGridParam('selrow') == rowid) {
        return false;
      } else {
        return true;
      }
    }
+5
source

Great solution, a little more compact version:

  beforeSelectRow: function(rowid, e) {
      return ($(this).getGridParam('selrow') != rowid);
  }
+7
source

All Articles