0

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

Community
  • 1
  • 1
user2067567
  • 3,695
  • 15
  • 49
  • 77
  • I think it just needs the `"name":"Airport"` part. The parsing error could be coming due to the problem that it is wrapped in items. And instead of a string it finds an object array – Ajo Koshy Mar 18 '13 at 09:45
  • Nothing to do with your particular problem, but this error also comes up also when the number of colNames mismatches the number of ColModel columns. – arame3333 May 19 '17 at 08:29

1 Answers1

3

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.

Oleg
  • 220,925
  • 34
  • 403
  • 798