Ext JS Learning Day Sixth Ext_window components (iii)

Source: Internet
Author: User

This article is used to record learning notes;

One more example today to consolidate the window of study;

– Example 2: Adding Subcomponents to the window and explaining how common find components are: • Focus Analysis: This example is mainly for the component of the search for detailed explanation, in the future application development, students should learn a variety of ways to find the required components, do not rigidly adhere to a particular form, This will bring many benefits to the development idea. –ownerct–up/down method –ext.getcmp Method Attach Chestnut code 1
Ext.onready (function(){//EX002: Adding subcomponents to components and making a series of actions for components//To add a subassembly to a component:var win =NewExt.window.Window ({title: "Add Child component Instance", Width: ' 40% ', height:400, RenderTo:Ext.getBody (), draggable:False,//Dragging resizable is not allowed:False,//Changing the window size is not allowed closable:False//Do not display the Close button collapsible:True,//Show Collapse button bodystyle: ' Background: #ffc; padding:10px; ',//Set style HTML: ' I am the content of window! ',//EXT items (Array) configuration sub-component configuration Itemsitems:[{//The Ext component gives us a simple way to write the Xtype property to create the component xtype: ' Panel ', Width: ' 50% ', height:100, HTML: ' I'm the Panel '},//The first form of a notationNewExt.button.Button ({text: ' I am a button ', Handler:function () {alert (' Execute!! ') ); }}) // second notation // {// xtype: ' button ', / / text: ' I am the button ', //// alert (' I was clicked '); // alert (btn.text); //}//} 
Chestnut Code 2
1 Ext.onready (function(){23//EX002: Adding subcomponents to components and making a series of actions for components456var win =NewExt.window ({7 ID: ' Mywin ',8 title: ' Form of Operation component ',9 width:500,Ten height:300,11RenderTo:Ext.getBody (),12//Indicates that a toolbar is added at the top of the current componenttbar:[{//Bbar (bottom) Lbar (Leftbar) Rbar (Rightbar) Fbar (Footbar)Text: ' button 1 ',Handler:function(BTN) {16//The components will have up and down methods (which indicate up, or down) that the required parameters are the xtype of the component or the selectorAlert (btn.up (' window '). title);18}19},{Text: ' button 2 ',Handler:function(BTN) {22//The most common wayAlert (ext.getcmp (' Mywin '). title);24}25},{Text: ' button 3 ',27 handler:function ( BTN) {28 //29 // console.info (BTN.OWNERCT); 30  alert (btn.ownerCt.ownerCt.title); 31  32 33 }); 34  Win.show ();  36 37});        
Learn to recommend a beautiful website www.fishcmonkey.com, improve the literary accomplishment is also good

Ext JS Learning Day Sixth Ext_window components (iii)

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.