ExtJS Study Notes (i)

Source: Internet
Author: User

This query returns an array with multiple elements, and selects all span labels for the entire document

Ext.query ("span");

This query returns an array of elements because the ID of Foo is queried.

Ext.query ("span", "foo");

This query returns an array containing an element of Foo!

Ext.query ("#foo");

Ext.query (". Foo");

This returns an array that contains all the elements of the document.
Ext.query ("*");

This returns an array of elements that contain the P tag's div tag
Ext.query ("div p");

Ext.get Selector

Ext.onready (function(){    varel = Ext.get ("The-id");El.addclass ("Special-css");//to add a style sheet to an elementEl.focus ();//move focus to El elementEl.addclassonfocus ("Focus-css");//Add and remove CSS classes for Get and lose focusEl.addclassonover ("Mouseover-css");//adding and removing CSS classes for mouse move-out eventsEl.addclassonclick ("Click-css");//Add and remove CSS classes for click eventsEl.setwidth (280);//set the width of the element to 100-phaseEl.setwidth (280,true);//set the width of the element to 100 with animation effectEl.addkeymap ({key: "C", Ctrl:true, Fn:fn1,scope:el});//bind El Elements call the FN function when the keyboard presses the CTRL + C keyEl.addkeylistener ({key: "G", Ctrl:true},fn1,el);//The same function as the above addkeymap, except that the parameters are passed differently.
Ext.select Selector
var el = Ext.select (["Div1"],true); El.on ("click",function  tes () { Ext.Msg.alert ("hint", "you clicked on the node with ID ' div1 ');});

EXT.GETCMP Selector (return Ext component Component Object)

// get the component with Id ' Panel1 ' var comp = ext.getcmp (' Panel1 '); Ext.Msg.alert (' hint ', "get the ID of ' panel1 ' of the component type is" +comp.getxtype ());

Ext.getdom selector (returns an HTML node element. Available)

var comp = ext.getdom (' Panel1 ');  Ext.Msg.alert (' hint ', ' ID of Dom obtained by Ext.getdom: ' +comp.id+ ' <br> get the panel's DOM by another way its ID: "+panel.el.dom.id");  

  



ExtJS Study Notes (i)

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.