Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.gwtext.client.core
Class XTemplate

    java.lang.Object
      com.gwtext.client.core.JsObject
          com.gwtext.client.core.XTemplate

    public class XTemplate

extends JsObject

A template class that supports advanced functionality like autofilling arrays, conditional processing with basic comparison operators, sub-templates, basic math function support, special built-in template variables, inline code execution and more. XTemplate also provides the templating mechanism built into `DataView`.

Field Summary

Fields inherited from class com.gwtext.client.core.JsObject
`jsObj`

Constructor Summary
`XTemplate(java.lang.String html)` Create a new Template.
`XTemplate(java.lang.String[] htmlfrags)` Create a new Template.

Method Summary
`java.lang.String` | `applyTemplate(com.google.gwt.core.client.JavaScriptObject values)`
`java.lang.String` | `applyTemplate(NameValuePair[] values)` Returns an HTML fragment of this template with the specified values applied.
`java.lang.String` | `applyTemplate(java.lang.String[] values)` Returns an HTML fragment of this template with the specified values applied.
`void` | `compile()` Compiles the template into an internal function, eliminating the RegEx overhead.
`java.lang.String` | `getHtml()`

Methods inherited from class com.gwtext.client.core.JsObject
`getJsObj, getProperties, isCreated, setJsObj`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### XTemplate

    public XTemplate(java.lang.String html)

  Create a new Template.

  Parameters:
    `html` - the HTML fragment

### XTemplate

    public XTemplate(java.lang.String[] htmlfrags)

  Create a new Template.

  Parameters:
    `htmlfrags` - the HTML fragments

Method Detail

### getHtml

    public java.lang.String getHtml()

### applyTemplate

    public java.lang.String applyTemplate(java.lang.String[] values)

  Returns an HTML fragment of this template with the specified values applied. Use this method when the params are numeric (i.e. {0})

  Parameters:
    `values` - the param values
  Returns:
    the html fragment

### applyTemplate

    public java.lang.String applyTemplate(NameValuePair[] values)

  Returns an HTML fragment of this template with the specified values applied. Use this method when the params are named (i.e. {foo})

  Parameters:
    `values` - the param values
  Returns:
    the html fragment

### applyTemplate

    public java.lang.String applyTemplate(com.google.gwt.core.client.JavaScriptObject values)

### compile

    public void compile()

  Compiles the template into an internal function, eliminating the RegEx overhead.

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD