jeudi 20 novembre 2014

Raw data from reader on nested json data

Hi,

I have a problem reading json data form a TreeStore.

I have the following Model defined:



Code:



Ext.define('TreeModel', {
extend: 'Ext.data.Model',
fields: [
{name: 'tag', type: 'string'},
{name: 'input', type: 'string'},
{name: 'type', type: 'string'},
{name: 'actionCol', type: 'string', defaultValue: true}
]
});

And its respective store:

Code:



var store = Ext.create('Ext.data.TreeStore', {
model: 'TreeModel',
proxy: {
type: 'ajax',
url: 'editorConverter/Collective_motion_problem.json',
reader: 'json'
},
folderSort: false
});

The problem comes when I try to get raw data from the reader with store.getProxy().getReader().rawData. The resulting json is only the root element and its immediate children, but no more descendant levels.

My Json file contains:



Code:



{"text":".","children": [ {"tag":"problem", "input": "none", "actionCol": "none", "expanded": false, "children":[
{"tag":"head", "input": "none", "actionCol": "none", "expanded": false, "children":[
{"tag":"name", "input": "Collective motion problem", "type": "string", "actionCol": "none"},
{"tag":"nameAbbreviation", "input": "none", "type": "string", "actionCol": "none"},
{"tag":"id", "input": "0100007f03297c2a0000013f7a85b63e", "type": "string", "actionCol": "none"},
{"tag":"author", "input": "Perico", "type": "string", "actionCol": "none"},
{"tag":"version", "input": "1", "type": "string", "actionCol": "none"}
]}
]}
]}

But I only get:


Code:



{"text":".","children": [ {"tag":"problem", "input": "none", "actionCol": "none", "expanded": false} ]}

I have a Tree panel where the content shown is complete. So the problem might not be in the store itself, but some configuration I am missing.

Can anybody help me?






Raw data from reader on nested json data

Aucun commentaire:

Enregistrer un commentaire