Get Data from Dataview item

I can’t seem to find the correct api command to I retrieve data from the selected item in dataview?

Can someone assist?

I’m Looking to get the item named NAME .

function template(item) {
let template = “

”;
template += “
” + item.INITIAL + “
”;
template += “
”;
template += “
” + item.NAME + “
”;
template += “” + item.CITY + ", " + item.STATE + “”;
template += “
”;
template += “
”;
template += “”;
template += “”;
template += “”;
template += “”;
template += “
”;
return template;
}

dataview.events.on(“click”, function(id, e){
console.log(“The item with the id “+ dataview.selection.getId(id) +” was clicked.”);

});

Please, try to use the getItem() method of the dataCollection:
https://docs.dhtmlx.com/suite/data_collection/api/datacollection_getitem_method/
like:

dataview.data.getItem(id).NAME
1 Like