PDA

View Full Version : Problem with JsonReader and MemoryProxy with an index value > 0


namespace
04-25-2007, 11:30 AM
I'm not sure this is a bug or a feature request, however:


When building the grid using JsonReader and MemoryProxy, I have an array that is parsed into json. Below are the arrays before they're parsed into json (because I think it's easier to read.)

Array (
[0] => Array
(
[assoc_id] => 1001
[id] => 1001
[leads_id] => 145651
[sale_objectives_id] => 1001
[owner_id] => 8166650
[created] => 2007-04-20 15:19:17.645127-05
[completed] =>
)

);

Here the index starts at 0 and builds the grid as expected.

The problem happens when the index value is greater than 0.
This will fail.

Array (
[1001] => Array
(
[id] => 1001
[leads_id] => 145651
[sale_objectives_id] => 1001
[owner_id] => 8166650
[created] => 2007-04-20 15:19:17.645127-05
[completed] =>
)

);

Here is the json:

{"1001":{"id":"1001","leads_id":"145651","sale_objectives_id":"1001","owner_id":"8166650","created":"2007-04-20 15:19:17.645127-05","completed":null}}

I would think that if the index value doesn't start at 0 the grid will build it's own array when parsing json data.

Animal
04-26-2007, 04:11 AM
The set of rows must be a regular, numerically indexed Array. These start at index 0, and go upwards:

So you complete Json object will look like:


}


So set the "root" to "data", and the "totalProperty" to "totalCount", and that will work.