开发者

$t.p.colModel[i] is undefined in grid.base.js

When I am calling getrowdata() I am getting this error $t.p.colModel[i] is undefined in grid.base.js

jQuery(jqgrid).jqGrid({
            url: url,
            datatype: 'json',
            mtype: 'GET',
            colNames: ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I'],
            colModel: [{ name: 'A', index: 'A', width: 50, align: 'right', sortable: true, resizable: false },
            { name: 'B', index: 'B', width: 50, align: 'right', sortable: true, sorttype: 'int', title: false, resizable: false },
            { name: 'C', index: 'C', width: 50, align: 'right', sortable: true, sorttype: 'int', resizable: false },
            { name: 'D', index: 'D', width: 40, align: 'right', sortable: true, sorttype: 'int', title: false, resizable: false },
            { name: 'E', index: 'E', width: 75, align: 'right', sortable: true, sorttype: 'float', resizable: false },
            { name: 'F', index: 'F', width: 75, sortable: true, datefmt: ' M  d, y H:i:s', resizable: false },
开发者_如何学Go            { name: 'G', index: 'G', width: 75, sortable: true, datefmt: ' M  d, y H:i:s', resizable: false },
            { name: 'H', index: 'H', width: 500, sortable: true, sorttype: 'text', resizable: false },
            { name: 'I', index: 'I', width: 300, sortable: true, sorttype: 'text', resizable: false}],
 jsonReader: {
                root: "A",
                page: "page",
                total: "total",
                records: "records",
                repeatitems: false
            }
});

jsondata format is

{ "total":"4",
    "page":"1",
    "records":"35",
    "A":[{
            "A":"01.000",
            "B":"01.000",
            "C":"01.000",
            "D":"1",
            "E":"1.075",
            "F":" 19:17:09",
            "G":" 11 19:17:09",
            "H":"dfsd",
            "I":""}]} 

getting error : $t.p.colModel[i] is undefined in grid.base.js(line 2470)


I had the same issue using jqGrid 3.6.2 while calling $("#myGrid").delRowData("myRowId"); The reason was a new cell added at runtime that included a html table <table><tr><td>cell value</td> .... It seems that the method $("#myGrid").delRowData counts incorrectly the jqGrid tds by including the ones of the inner table.


First, your JSON data should start with "{" ("{"total":"4",..."). Second, because you use "A" property as the array name of the rows ("A":[) you should use the following jsonReader:

jsonReader: {
    root: "A",
    repeatitems: false
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜