0
我必須插入對象作爲面板項目。我創建了對象,並在Panel中將項目放置爲一個數組。然後如何將該對象添加到數組的項目中。如何插入對象作爲面板項目
我的代碼:
{
title : "Records",
bodyStyle: 'background: #dfe8f6;border:#dfe8f6;',
autoScroll: true,
id:'ExcludeRecord',
region: 'center',
layout:{
type: 'vbox',
pack: 'start',
align: 'stretch'
},
items: [],
}`
我可以在任何'beforerender'或'afterrender'函數或'initComponent'函數中寫入。 – David
是的,你可以在任何函數中編寫函數,但是你必須在這個函數中有這些對象。 Ext.apply(me,{ items:[{object}], }); me.callParent(arguments); 您可以在initComponent中使用上述代碼將該對象直接作爲項目。 –
對於多記錄,我正在使用'for'循環。然後'panel.doLayout()'應該在裏面for循環的權利。在那種情況下,只有一個時間對象出現。 – David