On jqwidgets 4.2.1, I am noticing some odd behavior when I bind data to my grid.
I have an array of data that comes from the server like this:
[
{ firstName: “John”, lastName: “Doe”, age: 30 },
{ firstName: “Jack”, lastName: “Johnson” }
]
This data displays fine in my grid. When I have the exact same data come back from the server in the opposite order, however, the grid does not show ANY values in the age column. I’m guessing the grid looks to see what attributes are on the first record and ignores attributes that are not on it for the remaining rows.
//No age is shown in the grid for either record
[
{ firstName: “Jack”, lastName: “Johnson” },
{ firstName: “John”, lastName: “Doe”, age: 30 }
]
Do I have to change my server code to serialize null object attributes to support this odd behavior of jqxgrid, or is there some better way to handle absent properties on the client side with jqxgrid?
I am currently getting around this issue with:
[
{ firstName: “Jack”, lastName: “Johnson”, age: null },
{ firstName: “John”, lastName: “Doe”, age: 30 }
]
Thanks