jqGrid-防止取消选择行 [英] jqGrid - prevent deselecting of a row

查看:249
本文介绍了jqGrid-防止取消选择行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用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.

推荐答案

这是我和我兄弟提出的解决方法,只需将以下代码放在beforeSelectRow事件中即可:

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;
      }
    }

这篇关于jqGrid-防止取消选择行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆