PDA

View Full Version : json datastore problem



indeo
2 Apr 2011, 9:01 AM
I have problem with json datastore (Ext Designer reads 0 records). What wrong with this json:

{"sample":{"1":{"col1":"aaa1","col2":"bbb1"},"2":{"col1":"aaa2","col2":"bbb2"}}}
Thanks for help

hat27533
2 Apr 2011, 11:21 AM
Instead of :-

{"sample":{"1":{"col1":"aaa1","col2":"bbb1"},"2":{"col1":"aaa2","col2":"bbb2"}}}

try making "sample" an array :-

{"sample":[{"myID":1,col1":"aaa1","col2":"bbb1"},{"myID":2,col1":"aaa2","col2":"bbb2"}]}

adjust the store to suit

indeo
2 Apr 2011, 11:27 AM
It works! Thanks!