87,989
社区成员
发帖
与我相关
我的任务
分享
Ext.onReady(function() {
//TreePanel
var store = Ext.create('Ext.data.TreeStore', {
root: {
expanded: true,
text:"",
user:"",
status:"",
children: [
{ text:"detention", expanded: true,
children:[
{ leaf: true,text:'aaa'},
{ leaf: true,text:'bbb'}
]
},
{ text:"homework", expanded: true,
children: [
{ leaf: true,text:'ccc'}
]
},
{ text: "buy lottery tickets", leaf:true }
]
}
});
var txtTreePanel=Ext.create('Ext.tree.Panel', {
height: '100%',
store: store,
rootVisible: false,
listeners : {
itemclick : function(view,re){
alert(re.data.text);
}
}
});
//Viewport
Ext.create('Ext.container.Viewport', {
layout: 'border',
renderTo: Ext.getBody(),
items: [{
region: 'north',
html: '<h1 id="nobrDateTimeInfo" style="width:100%;text-align:right;"></h1>',
autoHeight: true,
border: false,
margins: '0 0 5 0',
height:'15%'
}, {
region: 'west',
collapsible: true,
title: 'Navigation',
width: 150,
items:txtTreePanel //树型导航
}, {
region: 'south',
title: 'South Panel',
collapsible: true,
html: 'Information goes here',
split: true,
height: 100,
minHeight: 100
}, {
region: 'east',
title: 'East Panel',
collapsible: true,
split: true,
width: 150
}, {
region: 'center',
xtype: 'tabpanel', // TabPanel itself has no title
activeTab: 0, // First tab active by default
items: {
title: 'Default Tab',
html: 'The first tab\'s content. Others may be added dynamically'
}
}]
});
});