function panel(){ var params={ title:"Hello", width:300, height:200, html:"<h1>一個(gè)面板</h1>", items:[ new Ext.Panel({title:"Panel1",height:100}), new Ext.Panel({title:"Panel2",height:100}) ] }; var panel=new Ext.Panel(params); panel.render("panel"); } 如果需要讓組件顯示出不同的效果,我們就需要通過構(gòu)造函數(shù)中的參數(shù)設(shè)置。 由于組件都繼承自Ext.Component,因此所有組件可能有共同的屬性,如下圖