EXTJS:怎么把tree菜单放到左面板里?
EXTJS:怎么把tree菜单放到左面板里Ext.onReady(function(){Ext.create('Ext.container.Viewport',{layo...
EXTJS:怎么把tree菜单放到左面板里
Ext.onReady(function () {
Ext.create('Ext.container.Viewport', {
layout: 'border',
items: [{
region: 'north',
title: '顶部',
html: '<h1 class="x-panel-header">头部</h1>',
border: false,
margin: '0 0 5 0'
}, {
region: 'west',
collapsible: true,
title: '左面板',
width: 150,
items: store
}
}]
});
});
//创建tree菜单
var store = Ext.create('Ext.data.TreeStore', {
root: {
expanded: true,
children: [{
text: "detention",
leaf: true
}, {
text: "homework",
expanded: true,
children: [{
text: "book report",
leaf: true
}, {
text: "algebra",
leaf: true
}]
}, {
text: "buy lottery tickets",
leaf: true
}]
}
}); 展开
Ext.onReady(function () {
Ext.create('Ext.container.Viewport', {
layout: 'border',
items: [{
region: 'north',
title: '顶部',
html: '<h1 class="x-panel-header">头部</h1>',
border: false,
margin: '0 0 5 0'
}, {
region: 'west',
collapsible: true,
title: '左面板',
width: 150,
items: store
}
}]
});
});
//创建tree菜单
var store = Ext.create('Ext.data.TreeStore', {
root: {
expanded: true,
children: [{
text: "detention",
leaf: true
}, {
text: "homework",
expanded: true,
children: [{
text: "book report",
leaf: true
}, {
text: "algebra",
leaf: true
}]
}, {
text: "buy lottery tickets",
leaf: true
}]
}
}); 展开
2个回答
展开全部
Ext.onReady(function () {
// 创建tree菜单
var store = Ext.create('Ext.data.TreeStore', {
root: {
expanded: true,
children: [{
text: "detention",
leaf: true
}, {
text: "homework",
expanded: true,
children: [{
text: "book report",
leaf: true
}, {
text: "algebra",
leaf: true
}]
}, {
text: "buy lottery tickets",
leaf: true
}]
}
});
Ext.create('Ext.container.Viewport', {
layout: 'border',
items: [{
region: 'north',
xtype: 'panel',
title: '顶部',
html: '<h1 class="x-panel-header">头部</h1>',
border: false,
margin: '0 0 5 0'
}, {
region: 'west',
xtype: 'panel',
collapsible: true,
title: '左面板',
width: 150,
layout: 'fit',
items: [{
xtype: 'treepanel', //这边引入treepanel
store: store //上面定义的store
}]
}, {
region: 'center',
xtype: 'panel',
title: '中间面板',
html: '<h1 class="x-panel-header">中间面板</h1>',
}]
});
});
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询