晨风

-------------------- 业精于勤,荒于嬉;行成于思,毁于随

导航

JqGrid单选

Posted on 2015-10-20 16:11  shenyixin  阅读(574)  评论(0编辑  收藏  举报

You have to do some more stuff:

1. Set multiboxonly to true and multiselect to true

2. Define the events onSelectRow and beforeSelectRow:

3. Define global variable: var lastSel;


The OnSelectRow and beforeSelectRow implementation:

onSelectRow: function (rowId, status, e) {
        var lastSel;
        if (rowId == lastSel) {
            $(this).jqGrid("resetSelection");
            lastSel = undefined;
            status = false;
        } else {
            lastSel = rowId;
        }
    },
beforeSelectRow: function (rowId, e) {
            $(this).jqGrid("resetSelection");
            return true;
        }

 

转自:http://stackoverflow.com/questions/6756131/jqgrid-single-select-checkbox