specifies a template for DataView items
var dataview = new dhx.DataView("dataview", {
itemsInRow: 4,
template: function(item) {
var template = "<div class='item_wrap'>";
template += "<img class='image' src=" + "..images/" + item.thumbnailName + " />";
template += "<h2 class='title'>" + item.value + "</h2>";
template += "<p class='description'>" + item.shortDescription + "</p>";
template += "</div>";
return template;
}
});
The template function takes one parameter:
item | (object) an object of a data item |