com.sencha.gxt.core.client.dom
Class DomHelper

java.lang.Object
  extended by com.sencha.gxt.core.client.dom.DomHelper

public class DomHelper
extends java.lang.Object

Utility class for creating elements from HTML fragments.


Constructor Summary
DomHelper()
           
 
Method Summary
static Element append(Element elem, java.lang.String html)
          Creates new DOM element(s) and appends them to el.
static Element insertAfter(Element elem, java.lang.String html)
          Creates new DOM element(s) and inserts them after el.
static Element insertBefore(Element elem, java.lang.String html)
          Creates new DOM element(s) and inserts them before el.
static Element insertFirst(Element elem, java.lang.String html)
          Creates new DOM element(s) and inserts them as the first child of el.
static Element insertHtml(java.lang.String where, Element el, java.lang.String html)
          Inserts an HTML fragment into the DOM.
static Element overwrite(Element elem, java.lang.String html)
          Creates new DOM element(s) and overwrites the contents of el with them.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DomHelper

public DomHelper()
Method Detail

append

public static Element append(Element elem,
                             java.lang.String html)
Creates new DOM element(s) and appends them to el.

Parameters:
elem - the context element
html - raw HTML fragment
Returns:
the new element

insertAfter

public static Element insertAfter(Element elem,
                                  java.lang.String html)
Creates new DOM element(s) and inserts them after el.

Parameters:
elem - the context element
html - raw HTML fragment
Returns:
the new element

insertBefore

public static Element insertBefore(Element elem,
                                   java.lang.String html)
Creates new DOM element(s) and inserts them before el.

Parameters:
elem - the context element
html - raw HTML fragment
Returns:
the new element

insertFirst

public static Element insertFirst(Element elem,
                                  java.lang.String html)
Creates new DOM element(s) and inserts them as the first child of el.

Parameters:
elem - the context element
html - raw HTML fragment
Returns:
the new element

insertHtml

public static Element insertHtml(java.lang.String where,
                                 Element el,
                                 java.lang.String html)
Inserts an HTML fragment into the DOM.

Parameters:
where - where to insert the html in relation to el - beforeBegin, afterBegin, beforeEnd, afterEnd.
el - the context element
html - the HTML fragment
Returns:
the inserted node (or nearest related if more than 1 inserted)

overwrite

public static Element overwrite(Element elem,
                                java.lang.String html)
Creates new DOM element(s) and overwrites the contents of el with them.

Parameters:
elem - the context element
html - raw HTML fragment
Returns:
the first new element


Copyright © 2012. All Rights Reserved.