且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

jqGrid:“内联编辑模式"中的所有行;默认情况下

更新时间:2022-06-26 01:21:57

您必须枚举网格的所有行并为每一行调用 editRow.代码可以如下所示

You have to enumerate all rows of grid and call editRow for every row. The code can be like the following

loadComplete: function () {
    var $this = $(this), ids = $this.jqGrid('getDataIDs'), i, l = ids.length;
    for (i = 0; i < l; i++) {
        $this.jqGrid('editRow', ids[i], true);
    }
}

或以下

loadComplete: function () {
    var $this = $(this), rows = this.rows, l = rows.length, i, row;
    for (i = 0; i < l; i++) {
        row = rows[i];
        if ($.inArray('jqgrow', row.className.split(' ')) >= 0) {
            $this.jqGrid('editRow', row.id, true);
        }
    }
}