jqGrid multiselect, checked-box persist when move to the next page

前端 未结 6 869
忘了有多久
忘了有多久 2021-02-06 03:56

If you see jqGrid demo :

http://www.trirand.com/blog/jqgrid/jqgrid.html

Section : Advanced --> Multiselect

You\'ll see that the checked checkbox is not p

6条回答
  •  日久生厌
    2021-02-06 04:42

    I found this :

        onSelectRow: function (id) {
            var p = this.p, item = p.data[p._index[id]];
            if (typeof (item.cb) === 'undefined') {
                item.cb = true;
            } else {
                item.cb = !item.cb;
            }
        },
        loadComplete: function () {
            var p = this.p, data = p.data, item, index = p._index, rowid;
            for (rowid in index) {
                if (index.hasOwnProperty(rowid)) {
                    item = data[index[rowid]];
                    if (typeof (item.cb) === 'boolean' && item.cb) {
                        $(this).jqGrid('setSelection', rowid, false);
                    }
                }
            }
        },
    

    It works pretty fine, I must say.

提交回复
热议问题