Sencha Touch JSON format?

I am new to Sencha Touch and am now developing sophisticated banking solutions using Sencha touch for mobile platforms. I worked a lot with jQuery, but new to Sencha. My question is, does sencha touch have any particular json format or will it accept any valid javascript object notation?

For example, below is the designation of the object

{"user": [{"name": "yyy","age": "10"},{"name": "xxx","age": "20"},{"name": "zzz","age": "30"}]}

I can associate the above dataset with a DataView sensor, but I cannot associate JSON in the format below

{"data": [["xxx","10"],["yyy","20"],["zzz","30"]]}

Why is this happening? Sencha looking for the exact key, a format for a pair of values? Or does he have an alternative in Sencha?

Any help would be appreciated.

+4
source share
1 answer

Ext.data.reader.Json expects the input to be formatted as your first example. If you have only the second avialble format, you can, for example, use Ext.data.reader.Array after the first to skip its thorough Ext.decode() to parse JSON in a real JS object.

+6
source

Source: https://habr.com/ru/post/1397826/


All Articles