PDA

View Full Version : Are text and children attribute mandatory in a json for Tree Store



pk.hafeez
3 Feb 2012, 1:42 AM
I find text and children mandatory in json data that is been passed to a tree store. For example

var store = Ext.create('Ext.data.TreeStore', {
model: 'Task',
proxy: {
type: 'ajax',
//the store will get the content from the .json file
url: 'treegrid.json'
},
folderSort: true
});

treegrid.json example where in it starts with text:".",children:

{"text":".","children": [
{
task:'Project: Shopping',
duration:13.25,
user:'Tommy Maintz',
iconCls:'task-folder',
expanded: true,


or

var treeStore = Ext.create('Ext.data.TreeStore', {
model: 'TableModel',
root : {"text":".", "children" : convertedScenariosData},
folderSort: true
});

How can i directly pass the json with out text and children attributes in it

Farish
3 Feb 2012, 2:00 AM
Please use code tags for your code (the hash sign you see when writing a post).

If you say leaf: true, then you shouldn't need children.