Мой код:
Ext.onReady(function() {
Ext.define('Unit', {
extend: 'Ext.data.Model',
fields: [
{name: 'task',type: 'string'}
]
});
var store = Ext.create('Ext.data.TreeStore', {
autoLoad: true,
model: 'Unit',
data:result,
proxy: {
type: 'memory',
reader: {
type: 'json'
}
}
});
var tree = Ext.create('Ext.tree.Panel', {
id:"treepanel",
title: 'Core Team Projects',
width: 500,
height: 300,
renderTo: Ext.getBody(),
collapsible: true,
useArrows: true,
rootVisible: false,
store: store,
multiSelect: true,
singleExpand: true,
//the 'columns' property is now 'headers'
columns: [{
xtype: 'treecolumn', //this is so we know which column will show the tree
text: 'Task',
flex: 2,
sortable: true,
dataIndex: 'task'
},{
//we must use the templateheader component so we can use a custom tpl
xtype: 'treecolumn',
text: 'Duration',
flex: 1,
sortable: true,
dataIndex: 'duration',
align: 'center'
}]
});
});
JSON: http://dev.sencha.com/deploy/ext-4.0.0/examples/tree/treegrid.json
Дерево не отображает мой результат, как это сделать? Я новый ExtJs4.
Извините, я не хочу использовать AJAX для получения результата.