Colnames&LT的长度;&GT; Colmodel问题的jqGrid [英] Length of Colnames <> Colmodel issue JQGrid
问题描述
我试图列装载到jqGrid的动态使用Ajax调用这里提到的jqGrid和动态绑定列
Am trying to load Columns to JQGrid Dynamically using Ajax calls as mentioned here jqGrid and dynamic column binding
我只是做了与1列一个样本。我的列名的JSON
i just did a sample with 1 column. My Column name JSON
"Data":["Airport"] which working just fine.
和问题是ColumnModel JSON低于
and the issue is with ColumnModel JSON below
{"colModelData":{"items":[{"name":"Airport"}]}
伊茨不工作。怎么办,我需要改变我的JSON,这样的jqGrid接受
Itz not working. How do i need to change my JSON so that JQGrid accepts
我怎样才能使它发挥作用?
how can i make it work ??
感谢
推荐答案
我认为,你只需要使用发布的数据中的错误的方式。也许你使用 colModel:result.colModelData code>而不是
的colModel:result.colModelData.items
这更符合JSON数据。
I think that you just use the posted data in the wrong way. Probably you use colModel: result.colModelData
instead of colModel: result.colModelData.items
which more corresponds the JSON data.
这是您可以使用 colModel
的项目标签
属性和方法的不指定任何 colNames
的
By the way you can use label
property in items of colModel
and don't specify any colNames
.
这篇关于Colnames&LT的长度;&GT; Colmodel问题的jqGrid的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!