I have a set of data like the following example and i would like to load it into the grid. However, i’m not sure how since the data doesn’t have an name.
[[48803,"DSK1","","02200220","OPEN"],[48769,"APPR","","77733337","ENTERED"]]
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
What you need is just use the following localReader
I made for you the demo which shows live how it works.
UPDATED: How I could find out the reality is not so good as the documentation. The usage of localReader could help you to fill the grid contain with data from
dataparameter with the custom structure, but another parts of jqGrid: local sorting and searching don’t work correct with this structure ofdataparameter. I interpret it as a bug. As a pragmatical solution I would recommend you to convert your custom data to array of named objects likewith the names corresponds to the column names in the
colModel. If you will usedataparameter in the form, everything will work perfect in jqGrid.UPDATED 2: Look at the source of the fixed example and it will be clear what I mean. In your case conversion of the data can be about the following
The solution is not so elegant like with
localReader, but it work without any restrictions.