const grid = new dhx.Grid("grid_container", {
columns: [
{ width: 150, id: "population", header: [{ text: "Population" }] },
{
width: 150,
id: "age",
header: [{ text: "Med. Age" }],
summary: { avgAge: "avg" }
}
],
summary: {
totalPopulation: ["population", "sum"],
},
data: dataset
});
// getting summary data for the component
const totalSummary = grid.getSummary();
console.log(totalSummary); //{ totalPopulation: 1000000 } - the sum of all the values in the "population" column
// getting summary data for a column
const columnSummary = grid.getSummary("age");
console.log(columnSummary); //{ totalPopulation: 1000000, avgAge: 28 } - the value of the "age" column only
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4