Ext.onready (function () {/** * description, add additional components to the Window, and perform related operations on the component */var win=new ext.window ({id: ' Mywin ', title: ' Form ', height:400, Width: ' 40% ', closable:false,//Disable Close button draggable:false,//tension drag resizable:false,//solid Fixed size, not allowed to stretch collapsible:true,//can be folded bodystyle: ' Background: #fff; padding:10px; ',//HTML: ' window content ' items:[{ID: ' panel_01 ',//Can be created by Xtype component xtype: ' Panel ', title: ' Panel ', Width: ' 100% ', height:200, HTML: ' Panel content '},{xtype: ' button ', Text: ' Buttons ',//click on Shang trigger Handler's handler function Handler:function (BTN) {alert (Btn.text)}}]}) Win.show (); Hide it first, continue with the following Operation Win.hide (); var win2=new Ext.window.Window ({id: ' myWin2 ', title: "title", height:400, width:400,//render to page Rendto:ex T.getbody (), tbar:[{text: ' button one ', Handler:function (BTN) {///by EXT provides a way to get the component that sets the ID alert (ext.getcmp ("Mywin 2 ").}},{Text: ' button two ', Handler:functioN (BTN) {//Select the ancestor's component by xtype or selector alert (btn.up ("window"). Title)}},{Text: ' button three ', Handler:function (btn {//Direct access to Parent component alert (Btn.ownerCt.ownerCt.title)}}]) Win2.show ()});
ExtJS Create window Instance two