I have a jqGrid which gets its data in JSON format by setting the url parameter.
Is it possible to create multiple columns and let them display the same property of the JSON response?
For example in one column i want to display the data formatted in one way, in another column i want to display the data in another way.
Yes, it's possible. The exact implementation depends from the format which you use in the server response. If you use jsonReader: { repeatitems: false } then one can use jsonmap property in colModel. jqGrid uses jsonmap instead of name during reading of response from the server. So the solution of your problem could be about the following
colModel: [
...
{ name: "mainColumn" },
...
{ name: "duplicate1OfMainColumn", jsonmap: "mainColumn" },
...
{ name: "duplicate2OfMainColumn", jsonmap: "mainColumn" },
...
]
Of case you can define different formatter for every from the columns.
If one have to use datatype: "xml" instead of datatype: "json" then one can use xmlmap instead of jsonmap.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With