我已經創建了動態選項卡,但無法從url加載數據。創建dymanic選項卡並從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();
});
});
每當我點擊按鈕只是調用上述功能,我可以看到選項卡,但內容不加載。
任何人都可以幫助我在哪裏錯了嗎?
@ user1584844正如我寫的,這是一個工作的例子。你將不得不提供更多的代碼來獲得進一步的幫助。 – sra
仍然我沒有得到你可以看看我的來源 – user1584844
@ user1584844我想你的問題是'url'格式。嘗試一個絕對的網址,看看它是否有效。 – sra