Class Ext.DomHelper
Package: | Ext |
Class: | DomHelper |
Extends: | Object |
Defined In: | DomHelper.js |
Utility class for working with DOM and/or Templates. It transparently supports using HTML fragments or DOM.
For more information see
this blog post with examples.
This class is a singleton and cannot be created directly.
属性
-
方法
-
事件
公共属性
|
useDom : Boolean |
DomHelper |
True to force the use of DOM instead of html fragments |
公共方法
|
append(String/HTMLElement/Element el , Object o , [Boolean returnElement ]) : HTMLElement |
DomHelper |
Creates new Dom element(s) and appends them to el |
|
applyStyles(String/HTMLElement el , String/Object/Function styles ) : void |
DomHelper |
Applies a style specification to an element |
|
createTemplate(Object o ) : Ext.DomHelper.Template |
DomHelper |
Creates a new Ext.DomHelper.Template from the Dom object spec |
|
insertAfter(String/HTMLElement/Element el , Object o , [Boolean returnElement ]) : HTMLElement |
DomHelper |
Creates new Dom element(s) and inserts them after el |
|
insertBefore(String/HTMLElement/Element el , Object o , [Boolean returnElement ]) : HTMLElement |
DomHelper |
Creates new Dom element(s) and inserts them before el |
|
insertFirst(String/HTMLElement/Element el , Object o , [Boolean returnElement ]) : HTMLElement |
DomHelper |
Creates new Dom element(s) and inserts them as the first child of el |
|
insertHtml(String where , HTMLElement el , String html ) : HTMLElement |
DomHelper |
Inserts an HTML fragment into the Dom |
|
markup(Object o ) : String |
DomHelper |
Returns the markup for the passed Element(s) config |
|
overwrite(String/HTMLElement/Element el , Object o , [Boolean returnElement ]) : HTMLElement |
DomHelper |
Creates new Dom element(s) and overwrites the contents of el with them |
公共事件
此类没有公共事件。
属性详情
useDom
public Boolean useDom
True to force the use of DOM instead of html fragments
This property is defined by DomHelper.
方法详情
append
public function append(String/HTMLElement/Element el
, Object o
, [Boolean returnElement
])
Creates new Dom element(s) and appends them to el
This method is defined by DomHelper.
applyStyles
public function applyStyles(String/HTMLElement el
, String/Object/Function styles
)
Applies a style specification to an element
参数:
el
: String/HTMLElementThe element to apply styles to
styles
: String/Object/FunctionA style specification string eg "width:100px", or object in the form {width:"100px"}, or a function which returns such a specification.
返回:
This method is defined by DomHelper.
createTemplate
public function createTemplate(Object o
)
Creates a new Ext.DomHelper.Template from the Dom object spec
参数:
返回:
Ext.DomHelper.Template
The new template
This method is defined by DomHelper.
insertAfter
public function insertAfter(String/HTMLElement/Element el
, Object o
, [Boolean returnElement
])
Creates new Dom element(s) and inserts them after el
This method is defined by DomHelper.
insertBefore
public function insertBefore(String/HTMLElement/Element el
, Object o
, [Boolean returnElement
])
Creates new Dom element(s) and inserts them before el
This method is defined by DomHelper.
insertFirst
public function insertFirst(String/HTMLElement/Element el
, Object o
, [Boolean returnElement
])
Creates new Dom element(s) and inserts them as the first child of el
This method is defined by DomHelper.
insertHtml
public function insertHtml(String where
, HTMLElement el
, String html
)
Inserts an HTML fragment into the Dom
This method is defined by DomHelper.
markup
public function markup(Object o
)
Returns the markup for the passed Element(s) config
This method is defined by DomHelper.
overwrite
public function overwrite(String/HTMLElement/Element el
, Object o
, [Boolean returnElement
])
Creates new Dom element(s) and overwrites the contents of el with them
This method is defined by DomHelper.