aggregates: [{
showChildSummary: true,
columns: [
{
type: 'Count',
field: 'UnitWeight',
columnName: 'UnitWeight',
footerTemplate: 'Count: ${Count}'
}]
}] |
let btn = document.getElementById("button");
let change = () => {
treegrid.columns = [
{ field: 'FreightName', width: 200, headerText: 'Freight Name' },
{ field: 'TotalUnits', headerText: 'Total Units', type: 'number', width: 140, textAlign: 'Right' } ]
}
btn.addEventListener("click", change); |
queryCellInfo: function(args){
let count = 0;
if(args.data["hasChildRecords"] == true && args.column.field == "FreightID" ){
var record = this.getCurrentViewRecords();
for( var i = 0; i < record.length; i++){
if(record[i].parentItem && args.data["uniqueID"] == record[i].parentItem.uniqueID ){
count++;
}
}
args.cell["innerText"] = args.cell["innerText"] + " " + "(" + count + ")" ;
}
} |