/** * Example Description: By clicking on a button to open a window, you need to avoid repeated open/Ext.onready (function () {///Get the DOM object that was wrapped through EXT, the original object is Btm.dom alert (btn.dom.value
)//jquery code var BTN = $ (' #btn '), btn[0].value var btn = ext.get ("btn"); Method one uses modal properties Btn.on ("click", Function () {ext.create ("Ext.window.Window", {title: ' Form ', height:400, width:300, Lay
Out: ' fit ',//Modal form modal:true,//form content, HTML content HTML: ' Click the button to open the form ',///Where to render the RenderTo:Ext.getBody ()}). Show ()} Method Two, define an ID, because all components can get Btn.on ("click", Function () {if (!) via ext getcmp. EXT.GETCMP ("Win")) {ext.create ("Ext.window.Window", {ID: ' win ', Title: ' Form ', Heig
ht:400, width:300, layout: ' fit ',//form content, HTML content HTML: ' Click the button to open Form 2 ', Where to render the RenderTo:Ext.getBody ()}). Show ()})//Method Three: First define a component, through the event to invoke the Sho of the component W () method var win=ext.create ("Ext.window.Window", {ID: ' Win ', title: ' Forms ', height:400, width:300, layout: ' fit ',//Close event just hide form Closeaction: ' Hide ',///form content, HTML content HTML: ' Click the button to open Form 2 ',///Where to render the rend
ErTo:Ext.getBody ()});
Btn.on (' click ', Function () {win.show (); })
})