jqGrid 两种列模型(TypeError: b is undefined)

jqGrid 的json支持两种列模型

1:如果用普通的json格式例如 {userId:1,username:"Malt"},那么需要配置

jsonReader: {
id : "userId",
repeatitems : false//如果为true 会报错
}


2:json格式{"id" :"1", "cell" :["Malt"]},这种形式不需要对应键值对,便可以再jqGrid中使用,repeatitems 默认配置为true,不用更改。


不过一般情况第一种比较常见,所以注意将repeatitems 设置为true,不然会报:

TypeError: b is undefined

你可能感兴趣的:(json,jqGrid)