Ext creates a window instance code through a button

Source: Internet
Author: User
/** * 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 (); })

})

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.