extjs4.1中如何实现点击左边的树,在右边展现相应的页面?给个简单的例子谢谢大虾门

如题所述

Ext.create('Ext.panel.Panel', {
width: 500,
height: 300,
title: 'Border Layout',
layout: 'border',
items: [{
title: 'South Region is resizable',
region: 'south', // position for region
xtype: 'treepanel',
height: 100,
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:"alegrbra", leaf:true}]},{ text:"buy lottery tickets", leaf:true}]}}),

split: true, // enable resizing,
listeners : {
itemclick: function(){
Ext.getCmp(''center'').add({xtype:'panel',html:'test'});
}
},
margins: '0 5 5 5'
},{
// xtype: 'panel' implied by default
title: 'West Region is collapsible',
region:'west',
xtype: 'panel',
margins: '5 0 0 5',
width: 200,
collapsible: true, // make collapsible
id: 'west-region-container',
layout: 'fit'
},{
title: 'Center Region',
id :'center',
region: 'center', // center region is required, no width/height specified
xtype: 'panel',
layout: 'fit',
margins: '5 5 0 0'
}],
renderTo: Ext.getBody()
});追问

确实是有个界面,但不是我想要的呀,我要的是west是树,点击west中的树,在center中展示树中叶子的不同界面,不过还是谢谢大虾

温馨提示:内容为网友见解,仅供参考
第1个回答  2013-03-20
是用iframe

extjs4.1中如何实现点击左边的树,在右边展现相应的页面?给个简单的例...
Ext.create('Ext.panel.Panel', { width: 500,height: 300,title: 'Border Layout',layout: 'border',items: [{ title: 'South Region is resizable',region: 'south', \/\/ position for region xtype: 'treepanel',height: 100,store : Ext.create('Ext.data.TreeStore',{ root:{...

相似回答