I am very new to ExtJs and I have the following code for a treeView,,which has a default root in the beginning and then an Ajax call to a servlet .But i don't understand the 'root' field with value 'data' .Is data an alias or xType .Here is the code:
Ext.define('Eits.view.OrgTreeView', {
extend : 'Ext.tree.TreePanel',
requires: ['Eits.model.OrgTreeModel'],
width : '100%',
region : 'center',
border : true,
store : {
xtype : 'tree',
fields : Eits.model.OrgTreeModel.FIELDS,
//model: 'Eits.model.OrgTreeModel',
autoLoad: false,
root: {
id: 'rootNode',
objectId : 'rootNode',
leaf: false,
expanded: false,
text : 'MTS',
iconCls : 'mts-Tree-Node',
},
proxy: {
type: 'ajax',
url: 'orgTree/getNavigationTree.action',
actionMethods: 'POST',
reader: {
type: 'json',
root: 'data'
}
}
}
root
property is:(Extjs's documentation is a great resource when using the framework)