By default, providing a template function enables auto-calculation. You can disable this behavior using the useAutoSummary property within columnContent or defaultContent.
Set useAutoSummary: false if you want to provide a custom template that does not rely on the Grid's automatic calculations.
Additionally, if you assign a plain HTML string directly to a column in columnContent or defaultContent (instead of an object with a template function), the Grid automatically sets useAutoSummary: false to prevent unnecessary calculations.
// Disabling auto summary via property
const grid = new Grid({
// ...,
summary: {
columnContent: {
col1: {
useAutoSummary: false,
template(summary) {
return 'max: ' + summary.max + '<br>min: ' + summary.min;
}
}
},
defaultContent: {
useAutoSummary: false,
template(summary) {
return 'default: ' + summary.sum;
}
}
}
});
// Disabling auto summary by providing a static string
const gridStatic = new Grid({
// ...,
summary: {
columnContent: {
col1: 'col1 content'
},
defaultContent: 'static content'
}
});