当前位置: 动力学知识库 > 问答 > 编程问答 >

asp.net mvc - Length of Colnames <> Colmodel issue JQGrid

问题描述:

Am trying to load Columns to JQGrid Dynamically using Ajax calls as mentioned here jqGrid and dynamic column binding

i just did a sample with 1 column. My Column name JSON

"Data":["Airport"] which working just fine.

and the issue is with ColumnModel JSON below

{"colModelData":{"items":[{"name":"Airport"}]}

Itz not working. How do i need to change my JSON so that JQGrid accepts

how can i make it work ??

Thanks

网友答案:

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.

By the way you can use label property in items of colModel and don't specify any colNames.

分享给朋友:
您可能感兴趣的文章:
随机阅读: