Skip to content

Commit

Permalink
[update] sidebar labels and titles for TreeGrid mode api
Browse files Browse the repository at this point in the history
  • Loading branch information
mafanya23 committed Nov 26, 2024
1 parent 3398546 commit 6befb5f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 13 deletions.
12 changes: 5 additions & 7 deletions docs/grid/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -1281,6 +1281,10 @@ const grid = new dhx.Grid("grid_container", {
},
data: dataset
});

// an example of getting the values of population density
const summary = grid.getSummary();
console.log(summary); // { totalPopulation: 1000000, totalArea: 50000, density: 20.00 }
~~~

In the above example the [`dhx.methods`](helpers/data_calculation_functions.md) helper is used to:
Expand All @@ -1290,13 +1294,7 @@ In the above example the [`dhx.methods`](helpers/data_calculation_functions.md)

### Getting the summary object

To get the object with the calculated values, you should use the [`getSummary()`](grid/api/grid_getsummary_method.md) method. When called without parameters, the method returns an object with the calculated values defined in the configuration of the component:

~~~jsx
// an example of getting the values of population density
const summary = grid.getSummary();
console.log(summary); // { totalPopulation: 1000000, totalArea: 50000, density: 20.00 }
~~~
To get the object with the calculated values, you should use the [`getSummary()`](grid/api/grid_getsummary_method.md) method. When called without parameters, the method returns an object with the calculated values defined in the configuration of the component.

You can also pass the `id` of a column to the method to get an object with the calculated values defined in the column's configuration together with the calculated values defined in the component's configuration. In the following example calculated values are used for rendering the summary for a column:

Expand Down
12 changes: 6 additions & 6 deletions sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -2732,10 +2732,10 @@ module.exports = {
items: [
{
type: "category",
label: "Grid TreeGrid mode methods",
label: "Methods",
link: {
type: 'generated-index',
title: "Grid TreeGrid mode methods",
title: "Methods",
keywords: ['grid treegrid mode methods'],
image: '/img/docusaurus.png'
},
Expand All @@ -2748,10 +2748,10 @@ module.exports = {
},
{
type: "category",
label: "Grid TreeGrid mode events",
label: "Events",
link: {
type: 'generated-index',
title: "Grid TreeGrid mode events",
title: "Events",
keywords: ['grid treegrid mode events'],
image: '/img/docusaurus.png'
},
Expand All @@ -2765,10 +2765,10 @@ module.exports = {
},
{
type: "category",
label: "Grid TreeGrid mode properties",
label: "Properties",
link: {
type: 'generated-index',
title: "Grid TreeGrid mode properties",
title: "Properties",
keywords: ['grid treegrid mode properties'],
image: '/img/docusaurus.png'
},
Expand Down

0 comments on commit 6befb5f

Please sign in to comment.