我想在tabPanel(對象Ext.tab.Panel)中顯示一個網格(EXTJS 4.1的對象Ext.grid.GridPanel),但我遇到問題:網格工程完美地作爲一個獨立的源代碼,面板也可以作爲一個獨立的源代碼。 但是,當我嘗試使網格和麪板一起工作時,它不起作用。EXT JS 4.1如何在tabPanel中顯示網格
網:
var monGridPanelDetailEcriture = new Ext.grid.GridPanel({
id: 'monGridPanelDetailEcriture',
frame: true,
width: 1100,
autoHeight: true,
renderTo: 'gridDetailEcriture',
store: monStoreDetailEcriture,
columns: mesColonnesDetailEcriture
});
的TabPanel:
var tabs = Ext.create('Ext.tab.Panel', {
renderTo: document.body,
width: 450,
activeTab: 0, // first tab initially active
defaults :{
bodyPadding: 10
},
items: [{
title: 'Short Text',
closable: true
},{
title: 'Long Text'
}]
});
我網上搜索解決方案,但每一次我發現沒有工作: 我想這個解決方案這是在幾個解釋論壇:
var tabs = Ext.create('Ext.tab.Panel', {
renderTo: document.body,
width: 450,
activeTab: 0, // first tab initially active
defaults :{
bodyPadding: 10
},
items: [{
monGridPanelDetailEcriture
},{
title: 'Long Text'
}]
});
但我有一個Javascript錯誤indicatin g這不是描述項目的方法。
我也嘗試在網格上創建一個新類型的小部件(屬性爲「別名」),但它不起作用。
有人有解決方案嗎?
非常感謝它完美的作品!並感謝您的建議,我將使用它。 – lilpeach
沒問題,很高興幫助 – dougajmcdonald