I am using the browser-layout example for my application.
I'm trying to add a tree grid to it. I defined a new class, but when I call my tree grid I can see the grid but no data inside.
What I'm trying to do is define the tree grid in a separate file. My main file is the layout-browser.js
and I need to add this (and others) in the tabs I have in it. What might I be doing wrong?
here is my code:
Ext.require([
'Ext.data.*',
'Ext.grid.*',
'Ext.tree.*'
]);
Ext.define('Task', {
extend: 'Ext.data.Model',
fields: [
{ name: 'task', type: 'string' },
{ name: 'user', type: 'string' },
{ name: 'duration', type: 'string' }
]
});
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
});
var tree = new Ext.tree.Panel({
title: 'Core Team Projects',
store : store,
columns:[
{
header: 'Task',
dataIndex: 'task',
width: 80
},{
header: 'Duration',
width: 80,
dataIndex: 'duration',
//align: 'center',
//sortType: 'asFloat'
},{
header: 'Assigned To',
width: 80,
dataIndex: 'user'
}]
});
Ext.define("Ext.app.myTreeGrid", {
extend: "Ext.panel.Panel",
width: 300,
height : 300,
items: [tree]
});
thank you for ur time and help