the component template
{ view:"template", type:"header", template:"This is a List Header"}
1 . Above is the common text template for template component:
2 . Data template for data-containing components:
{ view:"list", template:"#id#.#title#" }
// the list will show ID and title of each data item from the specified datasource
3 . Function template (takes data object and function parameter):
{ view:"list", template:function(obj){
return "<div class='overall'><div class='rank'>"
+obj.rank+"</div>"+
"<div class='title'>"+obj.title+"</div></div>"
}}
//the list will show rank and title of each item styled with specified CSS
4 . HTML templates defined within an HTML container:
{ view: "dataview", template:"html->template_container" }
5 . HTML template defined in the external file:
{ view:"dataview", template:"http->template.html" }
6 . Template component can load the external template by Ajax:
{ view:"template", src:"loadtext.php" }