ExtJS Knowledge Point Overview

Source: Internet
Author: User

1. Get ID

    • Ext.get ("Elid")--Creates a new instance once per call
    • Ext.fly ("Elid")--create only one instance at a time
    • Ext.getdom ("Elid")--htmlelement
    • Get DOM, Ext.fly (). Dom

2.CSS style operation

    • Ext.fly ("Elid"). AddClass ("Elcss") (corresponding Removeclass,hasclass,replaceclass)
    • Ext.fly ("Elid"). Toggleclass ("Elcss"), style switch
    • GetStyle:Ext.fly ("Elid"). GetStyle ("Color")
    • SetStyle:Ext.fly ("Elid"). SetStyle ({color: "Red", "font-weight": "Bold"})

3.DOM Query and traversal

    • Is (selector): Ext.get ("Elid"). Is ("Div.elclass")
    • Findparentnode (selector): Finds the parent node that matches the selector starting from the current node, and up(selector) is its abbreviation, but returns ext.element
    • Select: Finds child nodes of the current node, ext.fly ("Elid"). Select ("div"), which can be accessed using each
    • Query (selector): A.query ("Input.ipt")//return array
    • Child:Ext.fly ("Elid"). Child ("div"), Ext.fly ("Elid"). ("Div", true)//return native
    • ..... down,parent,next,prev,first,last

4.Dom operation

Ext.domhelper is a class used to generate HTML fragments, which are generated primarily by defining a JSON-formatted data.

<ul id= "ItemList", class= "list" ><li>1</li><li>1</li><li>1</li></ul >var list="ItemList" ,
Tag: "UL",
CLS: "List",
children:[
{tag: ' li ', HTML: ' 1 '},
{tag: ' li ', HTML: ' 2 '},
{tag: ' li ', HTML: ' 2 '}
]
}

var list={id: "ItemList" ,
Tag: "UL",
CLS: "List",
HTML: " <li>1</li><li>1</li><li>1</li>"
}
var a={
ID: "Link"
Tag: "A",
href: "url",
HTML: "Links"
}
    • Append subkey: AppendChild
var el=ext.get ("Elid1"); Ext.fly (// ext.fly(///Ext.fly ("Eld") is appended by ID . AppendChild (el.dom)  // append Ext.fly ("Eld") via Compositeelement . appendchild ( Ext.select ("div"))  

Other

    • return type: Ext.get (). $classname, if no this property indicates that the JS native object is returned
    • return type: Check return type can use Ext.typeof ()-More than native

ExtJS Knowledge Point Overview

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.