如图,extjs4 如何点击左侧tree中的链接,在右侧的center窗口打开页面呢?
部分代码在这里<scripttype="text/javascript">Ext.require(['Ext.tree.*','Ext.data.*',]);Ext.on...
部分代码在这里
<script type="text/javascript">
Ext.require([
'Ext.tree.*',
'Ext.data.*',
]);
Ext.onReady(function() {
var cw;
var store = Ext.create('Ext.data.TreeStore', {
root: {
expanded: true
},
proxy: {
type: 'ajax',
url: 'tree-data.json'
}
});
// create the Tree
var menu = Ext.create('Ext.tree.Panel', {
store: store,
region: 'west',
title: '管理菜单',
collapsible: true,
rootVisible: false,
hrefTarget: 'mainContent',
viewConfig: {
plugins: [{
ptype: 'treeviewdragdrop'
}]
},
width: 200
});
Ext.create('Ext.Viewport', {
layout: {
type: 'border',
padding: 5
},
defaults: {
split: true
},
items: [{
region: 'north',
hideHeaders: true,
split: true,
height: 80,
html: '<h1>测试</h1>',
},menu,{
region: 'center',
layout: 'border',
border: false,
items: [{
region: 'center',
id : 'mainContent',
html:'<iframe id="center-iframe" width="100%" height=100% name="center" frameborder="0" scrolling="auto" style="border:0px none; background-color:#BBBBBB; " ></iframe>',
title: 'Center',
items: [cw = Ext.create('Ext.Window', {
xtype: 'window',
closable: false,
minimizable: true,
title: 'Constrained Window',
height: 200,
width: 400,
constrain: true,
html: 'I am in a Container',
itemId: 'center-window',
minimize: function() {
this.floatParent.down('button#toggleCw').toggle();
}
})],
dockedItems: [{
xtype: 'toolbar',
dock: 'bottom',
items: ['Text followed by a spacer',
' ', {
itemId: 'toggleCw',
text: 'Constrained Window',
enableToggle: true,
toggleHandler: function() {
cw.setVisible(!cw.isVisible());
}
}]
}]
},{
region: 'south',
height: 100,
split: true,
collapsible: true,
title: 'Splitter above me',
html: 'center south'
}]
}]
});
});
</script> 展开
<script type="text/javascript">
Ext.require([
'Ext.tree.*',
'Ext.data.*',
]);
Ext.onReady(function() {
var cw;
var store = Ext.create('Ext.data.TreeStore', {
root: {
expanded: true
},
proxy: {
type: 'ajax',
url: 'tree-data.json'
}
});
// create the Tree
var menu = Ext.create('Ext.tree.Panel', {
store: store,
region: 'west',
title: '管理菜单',
collapsible: true,
rootVisible: false,
hrefTarget: 'mainContent',
viewConfig: {
plugins: [{
ptype: 'treeviewdragdrop'
}]
},
width: 200
});
Ext.create('Ext.Viewport', {
layout: {
type: 'border',
padding: 5
},
defaults: {
split: true
},
items: [{
region: 'north',
hideHeaders: true,
split: true,
height: 80,
html: '<h1>测试</h1>',
},menu,{
region: 'center',
layout: 'border',
border: false,
items: [{
region: 'center',
id : 'mainContent',
html:'<iframe id="center-iframe" width="100%" height=100% name="center" frameborder="0" scrolling="auto" style="border:0px none; background-color:#BBBBBB; " ></iframe>',
title: 'Center',
items: [cw = Ext.create('Ext.Window', {
xtype: 'window',
closable: false,
minimizable: true,
title: 'Constrained Window',
height: 200,
width: 400,
constrain: true,
html: 'I am in a Container',
itemId: 'center-window',
minimize: function() {
this.floatParent.down('button#toggleCw').toggle();
}
})],
dockedItems: [{
xtype: 'toolbar',
dock: 'bottom',
items: ['Text followed by a spacer',
' ', {
itemId: 'toggleCw',
text: 'Constrained Window',
enableToggle: true,
toggleHandler: function() {
cw.setVisible(!cw.isVisible());
}
}]
}]
},{
region: 'south',
height: 100,
split: true,
collapsible: true,
title: 'Splitter above me',
html: 'center south'
}]
}]
});
});
</script> 展开
2个回答
微测检测5.10
2023-05-10 广告
2023-05-10 广告
您好!建议咨 深圳市微测检测有限公司,已建立起十余个专业实验室,企业通过微测检测就可以获得一站式的测试与认 证解决方案;(EMC、RF、MFi、BQB、QI、USB、安全、锂电池、快充、汽车电子EMC、汽车手机互 联、语音通话质量),认证遇...
点击进入详情页
本回答由微测检测5.10提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询