Sys.UI.Template.instantiateIn Method

Instantiates the template within a given DOM element.

var o = MyTemplate.instantiateIn(containerElement, data, dataItem, dataIndex, nodeToInsertTemplateBefore, parentContext);

Parameters

Term

Definition

containerElement

The DOM element to instantiate the template within.

data

(Optional) The data collection, in the case where this instantiation is in the context of a collection. Used by the Sys.UI.DataView Class when binding to an array.

dataItem

(Optional) An object that the template will treat as current data item, and whose properties and fields will be exposed directly to the template for binding.

dataIndex

(Optional) An integer representing the index of the dataItem in the data collection.

nodeToInsertTemplateBefore

(Optional) The child node of container before which to instantiate the template.

parentContext

(Optional) The template context of the containing template, in the case where this template is nested in another template.

Return Value

A TemplateContext object.

See Also

Other Resources

Language Reference