最近在研究ExtJs的窗口組件(Ext.window),關於擴展顯示expand和折疊顯示collapse的一點心得記錄一下,以便后查。
var win2 = new Ext.window({ id : "TestWin", panelLayout: 'fit', resizable: true, modal : false, collapsible :true, collapseDirection:'top', title : "TEST", innerItems : pnlInner, buttons : [ ], listeners :{ collapse : function(){ this.setPosition(x,y); }, expand: function(){ this.center(); }, close :function(){ } } });
點擊下圖右上角的雙箭頭鈕,就可以在expand和collapse之間隨時切換顯示。只要把window的collapsible屬性設置成true,這個按鈕就可以顯示出來。
在expand顯示時,自定義的操作可以放在listener的expand函數里。
在collapse顯示時,自定義的操作可以放在listener的collapse函數里。
1,expand顯示
2,collapse折疊顯示