Skip to content

Commit 76fb1f9

Browse files
committed
[update] update and complete guides for v9.0
1 parent 59cc4ac commit 76fb1f9

File tree

4 files changed

+59
-27
lines changed

4 files changed

+59
-27
lines changed

docs/grid/features.md

Lines changed: 43 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ In this section you can find out how to initialize Grid, how to load data into t
4848

4949
### How to configure columns
5050

51-
In this section you will know how to configure Grid columns on Grid initialization.
51+
In this section you will get to know how to configure Grid columns on Grid initialization.
5252

5353
| Topic | Description |
5454
| ------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ |
@@ -61,7 +61,7 @@ In this section you will know how to configure Grid columns on Grid initializati
6161

6262
### How to configure rows
6363

64-
In this section you will know how to configure Grid rows on Grid initialization.
64+
In this section you will get to know how to configure Grid rows on Grid initialization.
6565

6666
| Topic | Description |
6767
| ---------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
@@ -88,13 +88,14 @@ In this section you can learn how to configure the header and footer of Grid, ho
8888
| --------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- |
8989
| [Configuring header/footer](../api/api_gridcolumn_properties/) | Learn how to configure a Grid header/footer ([Example](https://snippet.dhtmlx.com/9jl55ep7)) |
9090
| [Setting the height for header and footer](../configuration/#headerfooter-height) | Learn how to set the height for rows in the header and footer of Grid ([Example](https://snippet.dhtmlx.com/wjcjl80i)) |
91+
| [Setting the text for header and footer](../configuration/#headerfooter-text) | Learn how to set the text for rows in the header and footer of Grid ([Example](https://snippet.dhtmlx.com/9jl55ep7)) |
9192
| [Styling header cells](../customization/#styling-header-cells) | Learn how to set styling to the text of header cells ([Example](https://snippet.dhtmlx.com/7o4elf48)) |
9293
| [Styling footer cells](../customization/#styling-footer-cells) | Learn how to set styling to the text of footer cells ([Example](https://snippet.dhtmlx.com/d254hcvp)) |
9394

9495

9596
### How to configure tooltips
9697

97-
In this section you will know how to add tooltips of the desired appearance with the necessary information, or hide them if needed.
98+
In this section you will get to know how to add tooltips of the desired appearance with the necessary information, or hide them if needed.
9899

99100
| Topic | Description |
100101
| ----------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
@@ -114,7 +115,7 @@ In this section you will find out how to group cells in Grid and its header.
114115

115116
### How to configure drag-n-drop
116117

117-
In this section you will know how to configure the drag-n-drop functionality for Grid.
118+
In this section you will get to know how to configure the drag-n-drop functionality for Grid.
118119

119120
| Topic | Description |
120121
| ---------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- |
@@ -123,6 +124,21 @@ In this section you will know how to configure the drag-n-drop functionality for
123124
| [Drag-n-drop of multiple rows](grid/configuration.md#drag-n-drop-of-multiple-rows) | Learn how to allow end users to drag-n-drop several rows at once |
124125
| [Copying of rows during drag-n-drop](../api/grid_dragcopy_config/) | Learn how to copy a row to a target during drag-n-drop ([Example](https://snippet.dhtmlx.com/23slivyz)) |
125126

127+
## How to render custom statistics in the column header/footer and in the spans
128+
129+
In this section you will get to know how to render custom statistics in the column header/footer and in the spans.
130+
131+
| Topic | Description |
132+
| -----------------------------------------------------------| -----------------------------------------------|
133+
| [Defining the data calculation function](../helpers/data_calculation_functions/) | Learn how to define the default or create a custom statistical function for data calculation|
134+
| [Calculating a column summary](../configuration/#column-summary) | Learn how to form a summary list for a column ([Example](https://snippet.dhtmlx.com/jhjxjv2l))|
135+
| [Calculating a Grid summary](../configuration/#grid-summary) | Learn how to form a summary list for a Grid |
136+
| [Getting the summary object](../configuration/#getting-the-summary-object) | Learn how to get the summary object |
137+
| [Displaying custom statistics in the column header/footer text](../configuration/#headerfooter-text) | Learn how to render custom statistics in the text of a column header/footer|
138+
| [Displaying custom statistics in the column header/footer tooltip](../configuration/#column-headerfooter-tooltip) | Learn how to render custom statistics in the tooltip of a column header/footer|
139+
| [Displaying custom statistics in the spans](../configuration/#spans) | Learn how to render custom statistics in the spans|
140+
141+
126142
## How to configure sizes of Grid and its cells
127143

128144
In this section you can learn how to configure the size of Grid and its cells.
@@ -158,7 +174,7 @@ In this section you can learn how to configure the style of Grid and its cells.
158174

159175
## How to work with columns and rows
160176

161-
In this section you will know how to add and remove columns and rows, how to hide and show them, how to configure their sizes and align content inside the columns.
177+
In this section you will learn how to add and remove columns and rows, how to hide and show them, how to configure their sizes and align content inside the columns.
162178

163179
### Adding/removing columns and rows
164180

@@ -226,6 +242,18 @@ In this section you will find the ways of filtering data in Grid.
226242
| [Customizing filters in the header/footer](../configuration/#customizing-headerfooter-filters) | Learn how to add a custom function with your own logic for filtering data in a Grid column ([Example](https://snippet.dhtmlx.com/gcidkxjg)) |
227243
| [Getting the header filter](../api/grid_getheaderfilter_method/) | Learn how to get and use an object of the header filter ([Example](https://snippet.dhtmlx.com/n8srjle3)) |
228244

245+
### How to group data
246+
247+
In this section you will get to know how to group row data in Grid.
248+
249+
| Topic | Description |
250+
| ---------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
251+
| [Enabling data grouping](../usage/#enabling-data-grouping) | Learn how to enable row data grouping ([Example](https://snippet.dhtmlx.com/dvqy4ewe)) |
252+
| [Configuring data grouping](../usage/#configuring-data-grouping) | Learn how to configure row data grouping ([Example](https://snippet.dhtmlx.com/z3iw2p3k)) |
253+
| [Making group panel elements closable](../usage/#making-group-panel-elements-closable) | Learn how to make elements of the group panel closable ([Example](https://snippet.dhtmlx.com/z3iw2p3k)) |
254+
| [Using DataCollection API for data grouping](../usage/#using-datacollection-api-for-data-grouping) | Learn how to group Grid data with DataCollection API ([Example](https://snippet.dhtmlx.com/vo3pgkgh)) |
255+
256+
229257
## How to work with selection
230258

231259
In this section you will find the ways of working with selection functionality.
@@ -263,11 +291,19 @@ In this section you will learn how to scroll Grid to the necessary position.
263291

264292
## How to export Grid
265293

266-
In this section you will know how to export Grid to different formats.
294+
In this section you will get to know how to export Grid to different formats.
295+
296+
| Topic | Description |
297+
| --------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
298+
| [Exporting Grid to XLSX, CSV, PNG or PDF format](../usage/#exporting-data) | Learn how to export Grid to the necessary format ([Example 1](https://snippet.dhtmlx.com/58oqij47), [Example 2](https://snippet.dhtmlx.com/ti9l91mn)) |
299+
300+
## How to localize Grid
301+
302+
In this section you will get to know how to localize the interface of Grid.
267303

268304
| Topic | Description |
269305
| --------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
270-
| [Exporting Grid to XLSX, CSV, PNG. or PDF format](../usage/#exporting-data) | Learn how to export Grid to the necessary format ([Example 1](https://snippet.dhtmlx.com/58oqij47), [Example 2](https://snippet.dhtmlx.com/ti9l91mn)) |
306+
| [Localizing Grid](../localization/) | Learn how to apply different languages to the interface of dhtmlxGrid |
271307

272308
## How to work with Grid events
273309

docs/grid/usage.md

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,7 @@ With the Grid `groupable` property enabled you can:
536536
- or by clicking a group element on the group panel
537537
- edit the nesting level of grouping by modifying the grouping order by either moving elements to the group panel or removing elements from the group panel
538538

539-
**Related sample:** [Grid. Grouping (PRO)](https://snippet.dhtmlx.com/dvqy4ewe)
539+
**Related sample:** [Grid. Grouping](https://snippet.dhtmlx.com/dvqy4ewe)
540540

541541
The [`groupable`](grid/api/api_gridcolumn_properties.md) **property of a column** allows grouping data by the values of a certain column:
542542

@@ -591,7 +591,7 @@ const grid = new dhx.Grid("grid_container", {
591591
});
592592
~~~
593593

594-
**Related sample:** [Grid. Grouping customization (PRO)](https://snippet.dhtmlx.com/z3iw2p3k)
594+
**Related sample:** [Grid. Grouping customization](https://snippet.dhtmlx.com/z3iw2p3k)
595595

596596
- `hideableColumns` - (optional) specifies whether columns will be hidden on a group creation, *true* by default. If set to *false*, columns used for grouping will remain visible
597597

@@ -610,7 +610,7 @@ const grid = new dhx.Grid("grid_container", {
610610
});
611611
~~~
612612

613-
**Related sample:** [Grid. Grouping customization (PRO)](https://snippet.dhtmlx.com/z3iw2p3k)
613+
**Related sample:** [Grid. Grouping customization](https://snippet.dhtmlx.com/z3iw2p3k)
614614

615615
- `showMissed` - (optional) controls visibility of the elements that don't suit the grouping criteria (e.g. data without values), *true* by default. The following settings are available:
616616
- if set to *true*, the rows that don't have values for grouping are rendered row by row after all the data
@@ -634,7 +634,7 @@ const grid = new dhx.Grid("grid_container", {
634634
});
635635
~~~
636636

637-
**Related sample:** [Grid. Grouping missing data (PRO)](https://snippet.dhtmlx.com/0geopa0v)
637+
**Related sample:** [Grid. Grouping missing data](https://snippet.dhtmlx.com/0geopa0v)
638638

639639
- `fields` - (optional) predefines an extended configuration for data grouping by certain columns, by setting the rules of aggregation and rendering of the results. The attributes of the `fields` object correspond to the ids of columns for which the aggregation rules and the order of results are being configured. The configuration of a column is defined by the `IGroupOrder` object that has the following properties:
640640
- `map` - (optional) an object for data aggregation in a group, where the keys are field names, and the values can be:
@@ -688,7 +688,7 @@ b) the total rows under the grouped values set by the `summary` property
688688
- a user-defined aggregation function `((row: IRow[]) => string | number)`
689689
- `summary` - (optional) specifies where the total row is rendered - at the `top` or at the `bottom` of the group
690690

691-
**Related sample:** [Grid. Grouping customization (PRO)](https://snippet.dhtmlx.com/z3iw2p3k)
691+
**Related sample:** [Grid. Grouping customization](https://snippet.dhtmlx.com/z3iw2p3k)
692692

693693
Below you'll find the examples of configuring Grid via the `order` property:
694694

@@ -805,7 +805,7 @@ const grid = new dhx.Grid("grid_container", {
805805

806806
- `column` - (optional) defines the configuration of a column that renders values by the grouped data. This column will be used as a main one for structuring and rendering data grouped by value
807807

808-
**Related sample:** [Grid. Grouping customization (PRO)](https://snippet.dhtmlx.com/z3iw2p3k)
808+
**Related sample:** [Grid. Grouping customization](https://snippet.dhtmlx.com/z3iw2p3k)
809809

810810
You can specify the id of a column in two ways:
811811

@@ -860,8 +860,6 @@ column: {
860860
column: ICol
861861
) => string | boolean,
862862
align?: "left" | "center" | "right", // "left" by default
863-
colspan?: number,
864-
rowspan?: number,
865863
css?: string,
866864
content?: "inputFilter" | "selectFilter" | "comboFilter",
867865
filterConfig?: {
@@ -888,15 +886,11 @@ column: {
888886
column: ICol
889887
) => string | boolean,
890888
align?: "left" | "center" | "right", // "left" by default
891-
colspan?: number,
892-
rowspan?: number,
893889
css?: string,
894-
content?: "avg" | "sum" | "max" | "min" | "count",
895890
htmlEnable?: boolean, // false by default
896891
},
897892
],
898893
align?: "left" | "center" | "right", // "left" by default
899-
htmlEnable?: boolean, // false by default
900894
resizable?: boolean, // false by default
901895
sortable?: boolean, // true by default
902896
mark?: { min?: string, max?: string } |
@@ -928,7 +922,7 @@ const grid = new dhx.Grid("grid_container", {
928922
});
929923
~~~
930924

931-
**Related sample:** [Grid. Grouping customization (PRO)](https://snippet.dhtmlx.com/z3iw2p3k)
925+
**Related sample:** [Grid. Grouping customization](https://snippet.dhtmlx.com/z3iw2p3k)
932926

933927
You can also use the [`closable`](grid/api/api_gridcolumn_properties.md) configuration property of a column. It allows making a particular group panel element closable or permanently enabled:
934928

@@ -1039,7 +1033,7 @@ grid.data.group([{
10391033
}]);
10401034
~~~
10411035

1042-
**Related sample:** [Grouping and totals in the summary row via data collection (PRO)](https://snippet.dhtmlx.com/ihd6gtpj)
1036+
**Related sample:** [Grouping and totals in the summary row via data collection](https://snippet.dhtmlx.com/ihd6gtpj)
10431037

10441038
- grouping with the use of the `showMissed` property
10451039

@@ -1062,7 +1056,7 @@ grid.data.group(["city"], {
10621056
});
10631057
~~~
10641058

1065-
**Related sample:** [Grid. Grouping missing data (PRO)](https://snippet.dhtmlx.com/0geopa0v)
1059+
**Related sample:** [Grid. Grouping missing data](https://snippet.dhtmlx.com/0geopa0v)
10661060

10671061
#### Ungrouping Grid data
10681062

docs/helpers/data_calculation_functions.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,21 @@ const sum = dhx.methods.sum(rows, "value"); // 60
2020

2121
### Defining a custom functor
2222

23-
You can specify a custom function for calculating data. For example, you can use the `methods` helper function for adding custom calculations to [get a summary of counted values](grid/configuration.md#getting-the-summary-object). Thus, you can provide a functor that will calculate a doubled sum of values for a particular column:
23+
You can specify a custom function for calculating data. For example, you can use the `methods` helper function for adding custom calculations to [get a summary of counted values](grid/configuration.md#getting-the-summary-object).
2424

25-
~~~jsx {1-3,11,17-18}
25+
In the example below a custom functor `doubleSum()` that calculates a doubled sum of values for a particular column is defined. The result of its calculations is used to render statistics in the footer of the "population" column.
26+
27+
~~~jsx {1-3,10-11}
2628
dhx.methods.doubleSum = (rows, field) => {
2729
return rows.reduce((sum, row) => sum + row[field] * 2, 0);
2830
};
2931

3032
const grid = new dhx.Grid("grid_container", {
3133
columns: [
3234
{
33-
width: 150,
3435
id: "population",
3536
header: [{ text: "Population" }],
37+
footer: [{ text: (content) => content.doubleSum }],
3638
summary: "doubleSum"
3739
},
3840
],

docs/migration.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,17 +81,17 @@ const sum = dhx.methods.sum(rows, "value"); // 60
8181

8282
2. redefining the default functions:
8383

84-
~~~jsx title="From v9.0"
84+
~~~jsx {1-3,10-11} title="From v9.0"
8585
dhx.methods.doubleSum = (rows, field) => {
8686
return rows.reduce((sum, row) => sum + row[field] * 2, 0);
8787
};
8888

8989
const grid = new dhx.Grid("grid_container", {
9090
columns: [
9191
{
92-
width: 150,
9392
id: "population",
9493
header: [{ text: "Population" }],
94+
footer: [{ text: (content) => content.doubleSum }],
9595
summary: "doubleSum"
9696
},
9797
],

0 commit comments

Comments
 (0)