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)