我创建了动态选项卡,但无法从 url 加载数据。
Ext.onReady(function() {
var tabs = new Ext.TabPanel({
region:'center',
activeTab:0,
margins: '5 5 5 0',
resizeTabs:true,
minTabWidth: 115,
items:[{
title: 'Dashboard',
contentEl: 'simple-form',
closable:true
}]
});
var viewport = new Ext.Viewport({
layout:'border',
defaults: {
collapsible: false,
split: true
},
items: [{
title:'PSL Admin',
region: 'north',
contentEl: 'north',
margins: '5 5 5 5',
split:false
},{
title:'Navigation',
collapsible: true,
region:'west',
contentEl: 'west',
margins: '5 0 5 5',
cmargins: '5 5 5 5',
width: 175,
minSize: 100,
maxSize: 250
},
tabs
]
});
function addTab(){
tabs.add({
title: 'Bar',
closable: true,
plain: true,
loader: {
autoLoad:true,
url :'test.html'
}
});
}
Ext.get('add').on('click', function(){
addTab();
});
});
每当我单击仅调用上述函数的按钮时,我都可以看到选项卡,但未加载内容。
谁能帮忙我哪里错了?