You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/grid/api/grid_group_config.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -73,7 +73,7 @@ You can find the detailed description of the `group` object properties with exam
73
73
- a tuple `[string, TAggregate]` that specifies the field and the aggregation type ("sum", "count", "min", "max", "avg") from the `dhx.methods` helper
74
74
- a user-defined aggregation function `((row: IRow[]) => string | number)`
75
75
-`summary` - (optional) specifies where the total row is rendered - at the `top` or at the `bottom` of the group
76
-
-`column` - (optional) defines the configuration of a column that renders values of the grouped data. This column will be used as a main one for structuring and rendering data grouped by value
76
+
-`column` - (optional) defines the [configuration of a column](grid/usage.md/#configuration-of-the-column-property-of-the-group-object) that renders values of the grouped data. This column will be used as a main one for structuring and rendering data grouped by value
Copy file name to clipboardExpand all lines: docs/grid/usage.md
+28-38Lines changed: 28 additions & 38 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,7 +18,7 @@ The API of DHTMLX Grid allows setting configuration of columns, getting an objec
18
18
19
19
You can specify the configuration of Grid columns on the fly via the [](grid/api/grid_setcolumns_method.md) method. It takes an array with columns objects as a parameter.
@@ -43,7 +43,7 @@ The method returns an object with configuration of the specified column. You can
43
43
44
44
There is the [](grid/api/grid_getcellrect_method.md) method that returns an object with coordinates of a cell. The method takes as parameters the ids of the row and the column the cell belongs to:
45
45
46
-
~~~js
46
+
~~~jsx
47
47
constrect=grid.getCellRect("1", "c");
48
48
// -> { x: 200, y: -40, height: 40, width: 200 }
49
49
~~~
@@ -75,7 +75,7 @@ The return object includes the following attributes:
75
75
76
76
It is possible to show and hide a column in the grid via the [](grid/api/grid_showcolumn_method.md) and [](grid/api/grid_hidecolumn_method.md) methods.
77
77
78
-
~~~js
78
+
~~~jsx
79
79
//showing a column
80
80
grid.showColumn(colId);
81
81
//hiding a column
@@ -90,7 +90,7 @@ Since the object of a column has the [hidden](grid/configuration.md#hidden-colum
90
90
91
91
You can check whether a column is hidden or shown on a page using the [](grid/api/grid_iscolumnhidden_method.md) method. The method returns *true*, if a column is hidden, and *false* if it's visible.
You may want to manipulate a filter specified in the header of a grid, for example, to set/unset focus on the filter, to change the filter, or clear it. To do that, you should apply the [](grid/api/grid_getheaderfilter_method.md) method to get an object with methods of the header filter and apply the necessary method. For example:
You may add a new row into the grid by using the [](../data_collection/api/datacollection_add_method.md) method of **DataCollection**:
132
132
133
-
~~~js
133
+
~~~jsx
134
134
grid.data.add({
135
135
"country":"Estonia",
136
136
"population":"1326535",
@@ -150,13 +150,13 @@ grid.data.add({
150
150
151
151
To remove the necessary row from the grid, apply the [](../data_collection/api/datacollection_remove_method.md) method of **DataCollection**. Pass the id of the row that should be removed to the method:
152
152
153
-
~~~js
153
+
~~~jsx
154
154
grid.data.remove("5");
155
155
~~~
156
156
157
157
Here is an example of removing a currently selected row:
158
158
159
-
~~~js
159
+
~~~jsx
160
160
constcell=grid.selection.getCell();
161
161
grid.data.remove(cell.row.id);
162
162
~~~
@@ -169,15 +169,15 @@ For more information about the selection functionality in Grid, read the [Select
169
169
170
170
If you need to remove all rows at once, use the [](../data_collection/api/datacollection_removeall_method.md) method of **DataCollection**:
171
171
172
-
~~~js
172
+
~~~jsx
173
173
grid.data.removeAll();
174
174
~~~
175
175
176
176
### Hiding/showing a row
177
177
178
178
Starting from v7.0, it is possible to show and hide a row in the grid via the [](grid/api/grid_showrow_method.md) and [](grid/api/grid_hiderow_method.md) methods.
179
179
180
-
~~~js
180
+
~~~jsx
181
181
//showing a row
182
182
grid.showRow(rowId);
183
183
//hiding a row
@@ -190,7 +190,7 @@ grid.hideRow(rowId);
190
190
191
191
You can check whether a row is hidden or shown on a page using the [](grid/api/grid_isrowhidden_method.md) method. The method returns *true*, if a row is hidden, and *false* if it's visible.
192
192
193
-
~~~js
193
+
~~~jsx
194
194
grid.isRowHidden("1"); // -> true|false
195
195
~~~
196
196
@@ -204,7 +204,7 @@ You can manipulate columns and rows spans inside the grid with the help of the c
204
204
205
205
In order to add a column/row span into the grid, use the [](grid/api/grid_addspan_method.md) method. Pass an object with configuration of a span as a parameter:
206
206
207
-
~~~js
207
+
~~~jsx
208
208
grid.addSpan({
209
209
row:"0",
210
210
column:"a",
@@ -248,7 +248,7 @@ These are possible fields of a span object:
248
248
249
249
You can return the column/row span a cell is a part of using the [](grid/api/grid_getspan_method.md) method. It takes the ids of the row and the column the cell belongs to as parameters:
@@ -259,7 +259,7 @@ As a result, you'll get an object with a span configuration, if any span include
259
259
260
260
To remove an existing span, make use of the [](grid/api/grid_removespan_method.md) method. It takes the ids of the row and the column as parameters:
261
261
262
-
~~~js
262
+
~~~jsx
263
263
grid.removeSpan("10", "a");
264
264
~~~
265
265
@@ -283,7 +283,7 @@ You can filter grid data by the specified criteria with the help of the `filter(
283
283
</table>
284
284
<br/>
285
285
286
-
~~~js
286
+
~~~jsx
287
287
grid.data.filter(function (item) {
288
288
returnitem.a>0&&item.b!=="Apple";
289
289
});
@@ -453,15 +453,15 @@ You can easily edit the desired cell of a grid with the help of the [](grid/api/
453
453
454
454
For example, you can edit the first cell of the "project" column like this:
455
455
456
-
~~~js
456
+
~~~jsx
457
457
grid.editCell(grid.data.getId(0), "project");
458
458
~~~
459
459
460
460
**Related sample**: [Grid. Edit the first cell](https://snippet.dhtmlx.com/pqbax5vs)
461
461
462
462
To finish editing of a cell, use the [](grid/api/grid_editend_method.md) method. The method takes a *boolean* value as a parameter to define whether the edited data will be saved after the editing of a cell is complete (if *true*, the made changes won't be saved).
463
463
464
-
~~~js
464
+
~~~jsx
465
465
grid.editEnd(); // the edited data will be saved
466
466
467
467
grid.editEnd(true); // the edited data won't be saved
@@ -930,6 +930,8 @@ const grid = new dhx.Grid("grid_container", {
930
930
});
931
931
~~~
932
932
933
+
#### Configuration of the column property of the group object
934
+
933
935
A column with grouped data may contain the following properties in its configuration:
934
936
935
937
~~~jsx
@@ -946,19 +948,9 @@ column: {
946
948
) => string | boolean,
947
949
align?:"left"|"center"|"right", // "left" by default
@@ -1185,15 +1175,15 @@ The API of DHTMLX Grid provides the possibility to set scrolls to the necessary
1185
1175
1186
1176
You can scroll grid content to exact position defined by x and y coordinates via the [](grid/api/grid_scroll_method.md) method. Pass the coordinates as parameters of the method.
1187
1177
1188
-
~~~js
1178
+
~~~jsx
1189
1179
grid.scroll(75, 230);
1190
1180
~~~
1191
1181
1192
1182
### Scrolling to specific grid cell
1193
1183
1194
1184
It is also possible to scroll grid content to a particular cell. Pass the ids of the row and the column as parameters:
1195
1185
1196
-
~~~js
1186
+
~~~jsx
1197
1187
grid.scrollTo("15", "c");
1198
1188
~~~
1199
1189
@@ -1203,7 +1193,7 @@ grid.scrollTo("15", "c");
1203
1193
1204
1194
To return the current state of scroll, use the [](grid/api/grid_getscrollstate_method.md) method.
0 commit comments