I am using JSON to get the data.
What is happening the JSON-P changes the order of column and put them alphabetically.
The JSON is:
[{ "Grade"="pv" , "ID" = 1 , "Name" = "test" }]
But i actually send it ID first.
After getting this JSON i use the following line:
var array = typeof objArray != 'object' ? JSON.parse(objArray) : objArray;
Then i am about to convert this array to an HTML table.
But when i bond HTML label i want to show the Column ID first and so on. (Means i can configure using jquery which column to show first).
How can i do that efficiently?
The Question is rewritten because lot of users are not able to understand my question because of lack of my communication skills
Eaxmple: (Whatever the format i get does not matter but using Jquery how can i able to hardcode which column to show first)
Its like changing the array column order
Thanks
The data represented by an object in JSON has no inherent order, so you can’t count on JSON to maintain an order for an unordered object. If order is important, but arbitrary, your best bet is to use an ordered object such as an array to store the data.
Barring that, you can keep a side-by-side index in an array to help you recover the order.