Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jqGrid - prevent deselecting of a row

Tags:

select

jqgrid

Using jqGrid, if I click the selected row again, the row is deselected.

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

like image 727
Dylan Avatar asked Dec 18 '25 17:12

Dylan


2 Answers

Great solution, a little bit more compact version:

  beforeSelectRow: function(rowid, e) {
      return ($(this).getGridParam('selrow') != rowid);
  }
like image 128
Ofer Zelig Avatar answered Dec 21 '25 06:12

Ofer Zelig


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

  beforeSelectRow: function(rowid, e) {
      if ($(this).getGridParam('selrow') == rowid) {
        return false;
      } else {
        return true;
      }
    }
like image 20
Kirk Olson Avatar answered Dec 21 '25 05:12

Kirk Olson



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!