template

the component template

string|function template;

Example

{view:"diagram", template:"value"}

Details
  1. Data template for data-containing components:
// the diagram will show value of each data item from the specified datasource
{ view:"diagram", template:"value" }
  1. Function template (takes data object as a parameter):
{ view:"diagram", template:function(obj){
  if(obj.type == "text")
    return obj.value?"<span class='yes'>YES</span>":"<span class='no'>NO</span>";
  return obj.value;
}}
  1. HTML templates defined within an HTML container:
{ view: "diagram", template:"html->template_container" }
  1. HTML template defined in the external file:
{ view:"diagram", template:"http->template.html" }
See also
Back to top