|
<ejs-grid id="Grid" dataSource="ViewBag.datasource" load="load " allowPaging="true" allowSorting="true" allowFiltering="true">
<e-grid-aggregates>
. . . . .
<e-aggregate-column field="ShipCountry" type="Custom" footerTemplate="Brazil Count:${Custom}"></e-aggregate-column>
<e-grid-columns>
. . . .
</e-grid-columns>
</ejs-grid>
<script>
function load() {
this.aggregates[0].columns[0].setPropertiesSilent({ customAggregate: customAggregateFn });
}
function customAggregateFn(data) {
return data.result.filter(function (item) {
return item['ShipCountry'] === 'Brazil';
}).length;
}
</script> |
|
|