PDA

View Full Version : JSON data with paged grid, missing duplicate line


MaxT
04-05-2007, 10:56 AM
I have a question about getting data in JSON format for a paged grid.

Most of the data shows ok in three columns.
However, the third row of data (marked in red) doesn't show in the grid. This appears to be because of the duplicate value "1" in the first column.

Is this a bug, or can't you have duplicate rows in the JSON data?

Thanks for any suggestions.

Max



This is the start of the data, copied from Firebug.


{"assets":
[
{"ASSETID":"-","UNITIDENT":"-","ASSETFIELD1":"-"},
{"ASSETID":"1","UNITIDENT":"1","ASSETFIELD1":"1"},
{"ASSETID":1,"UNITIDENT":"1","ASSETFIELD1":"ABBEY CLOSE"},
{"ASSETID":2,"UNITIDENT":"2","ASSETFIELD1":"ABBEY CLOSE"},
...etc...

tryanDLS
04-05-2007, 11:17 AM
Did you specify AssestID as the id field to the JsonReader? If so, that's the key to the collection, so the 2nd one overwrites the 1st one. You could pass a null as the 1st arg to JsonReader to autogenerate unique lDs. I haven't tested that, but it works with ArrayReader.

MaxT
04-10-2007, 04:14 AM
Yes, that's exactly what I did. Removing the id seems to have fixed it ok, autogenerating the ids is what I require in this case.

Many thanks for your solution.

Max