Template<TModel>
Represents a template that can contain both string content and Telerik UI components.
Definition
Namespace:Kendo.Mvc.UI
Assembly:Kendo.Mvc.dll
Type Parameters:
TModel
The type of the model that the template is bound to.
Syntax:
public class Template<TModel>
Inheritance: objectTemplate<TModel>
Inherited Members
Constructors
Initializes a new instance of the Template<TModel> class.
public Template(WidgetFactory<TModel> widgetFactory)
The widget factory that creates widgets within this template.
Fields
A placeholder used to inject additional content during serialization.
public const string AdditionalContentPlaceholder = "/*kendoTmpPlaceholder*/"
Properties
Gets the collection of template items.
public ICollection<object> Items { get; }
WidgetFactory
WidgetFactory<TModel>
Gets the widget factory associated with this template.
public WidgetFactory<TModel> WidgetFactory { get; }
Methods
Serializes the template as a JavaScript function.
public string Serialize()
A JavaScript function string that renders the template content.
This method generates a JavaScript function that renders the template items. The function accepts a data parameter and returns the generated content as a string.
Serializes the template as a JavaScript function suitable for form editors.
public string SerializeFormEditor()
A JavaScript function string that renders the template content for form editing.
This method generates a JavaScript function that renders the template items as form elements. The function accepts container and options parameters, and appends the generated content to the container.