Skip to content

Commit db81949

Browse files
committed
[update] grid modules configs and related guides
1 parent 5b2778c commit db81949

File tree

8 files changed

+51
-48
lines changed

8 files changed

+51
-48
lines changed

docs/grid/api/grid_blockselection_config.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ blockSelection?:
3131
dir: "up" | "down" | "right" | "left";
3232
index: number;
3333
grid: IProGrid;
34-
}) => void);
34+
}) => { prev: any; current: any } | void);
3535
};
3636
area?: boolean;
3737
};
@@ -64,19 +64,19 @@ The `blockSelection` property can be set in two ways:
6464
<tbody>
6565
<tr>
6666
<td><b>disabled</b></td>
67-
<td>disables the module on startup, `false` by default</td>
67+
<td>(<i>boolean</i>) disables the module on startup, `false` by default</td>
6868
</tr>
6969
<tr>
7070
<td><b>mode</b></td>
71-
<td>the operating mode of the module:<ul><li><i>"range"</i> - managed through the <a href="../../usage_rangeselection/">`RangeSelection` module</a></li><li><i>"manual"</i> - managed through the manual control</li></ul></td>
71+
<td>(<i>string</i>) the operating mode of the module:<ul><li><i>"range"</i> - managed through the <a href="../../usage_rangeselection/">`RangeSelection` module</a></li><li><i>"manual"</i> - managed through the manual control</li></ul></td>
7272
</tr>
7373
<tr>
7474
<td><b>handle</b></td>
75-
<td>enables the handle for resizing. Can be set as a *boolean* value or as an *object*, `true` by default. <br>As an *object* can contain the following properties:<ul><li><b>allowAxis</b> - restricts the handle movement: `"x"` (horizontal), `"y"` (vertical), `"xy"` (both directions). `"xy"` by default</li><li><b>handler</b> - a *function* to process the handle actions or *boolean* to enable/disable. As a *function*, the property takes the following parameters:</li><ul><li><b>cell</b> - the object of the current cell. Contains the following properties:</li><ul><li>*row* - the configuration object of a row</li><li>*column* - the configuration object of a column</li></ul></ul><ul><li><b>array</b> - an array of all selected cells. Each cell object contains the following properties: </li><ul><li>*row* - the configuration object of a row</li><li>*column* - the configuration object of a column</li></ul></ul><ul><li><b>range</b> - an array of pre-selected cells. Each cell object contains the following properties: </li><ul><li>*row* - the configuration object of a row</li><li>*column* - the configuration object of a column</li></ul></ul><ul><li><b>dir</b> - the direction of cells selection: "up" | "down" | "right" | "left"</li></ul><ul><li><b>index</b> - the index of the iterated cell</li></ul><ul><li><b>grid</b> - the `dhx.Grid` component object</li></ul></ul></td>
75+
<td>(<i>boolean | object</i>) enables the handle for resizing or provides additional configuration options, `true` by default. As an *object* can contain the following properties:<ul><li><b>allowAxis</b> - (<i>string</i>) restricts the handle movement: `"x"` (horizontal), `"y"` (vertical), `"xy"` (both directions). `"xy"` by default</li><li><b>handler</b> - (<i>function | boolean</i>) a *function* to process the handle actions or *boolean* to enable/disable. As a *function*, the property takes the following parameters:</li><ul><li><b>cell</b> - (<i>object</i>) the object of the current cell. Contains the following properties:</li><ul><li>*row* - the configuration object of a row</li><li>*column* - the configuration object of a column</li></ul></ul><ul><li><b>array</b> - (<i>array</i>) an array of all selected cells. Each cell object contains the following properties: </li><ul><li>*row* - the configuration object of a row</li><li>*column* - the configuration object of a column</li></ul></ul><ul><li><b>range</b> - (<i>array</i>) an array of pre-selected cells. Each cell object contains the following properties: </li><ul><li>*row* - the configuration object of a row</li><li>*column* - the configuration object of a column</li></ul></ul><ul><li><b>dir</b> - (<i>string</i>) the direction of cells selection: "up" | "down" | "right" | "left"</li></ul><ul><li><b>index</b> - (<i>number</i>) the index of the iterated cell</li></ul><ul><li><b>grid</b> - (<i>object</i>) the `dhx.Grid` component object</li></ul>The <b>handler</b> function may return an <i>object with the history of Grid actions</i>. The returned object contains the following properties:<ul><li><b>prev</b> - the previous cell value</li><li><b>current</b> - the new cell value</li></ul></ul></td>
7676
</tr>
7777
<tr>
7878
<td><b>area</b></td>
79-
<td>enables the display of the selection area, `true` by default</td>
79+
<td>(<i>boolean</i>) enables the display of the selection area, `true` by default</td>
8080
</tr>
8181
</tbody>
8282
</table>
@@ -198,7 +198,9 @@ function blockSelectionHandler({ cell, array, index, grid }) {
198198

199199
**Related sample:** [Grid. BlockSelection. Work with the handle configuration](https://snippet.dhtmlx.com/8kttktiy)
200200

201-
**Related article:** [Managing block selection in Grid](grid/configuration.md/#managing-block-selection-in-grid)
201+
**Related articles:**
202+
- [Managing block selection in Grid](grid/configuration.md/#managing-block-selection-in-grid)
203+
- [Work with BlockSelection module](grid/usage_blockselection.md)
202204

203205
@changelog: added in v9.2
204206

docs/grid/api/grid_clipboard_config.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ The `clipboard` property can be set in two ways:
4949

5050
- as a *boolean* value it enables or disables the `clipboard` module upon the component initialization
5151
- as an *object* it enables the module and allows defining [modifier functions](grid/usage_clipboard.md/#using-formatter-functions) for data processing. The following properties are available:
52-
- `copyModifier` - modifies data before copying to the clipboard. Accepts as parameters the cell value, the cell object, and the `cut` flag (set to `true`, if it's a cut operation)
53-
- `cutModifier` - modifies the cell data before cutting (before clearing the cell). Accepts as parameters the cell value and the cell object
54-
- `pasteModifier` - modifies data from the clipboard before pasting into a cell. Accepts as parameters the cell value and the cell object
52+
- `copyModifier` - (*function*) modifies data before copying to the clipboard. Accepts as parameters the cell value, the cell object, and the `cut` flag (set to `true`, if it's a cut operation)
53+
- `cutModifier` - (*function*) modifies the cell data before cutting (before clearing the cell). Accepts as parameters the cell value and the cell object
54+
- `pasteModifier` - (*function*) modifies data from the clipboard before pasting into a cell. Accepts as parameters the cell value and the cell object
5555

5656
The example below demonstrates the clipboard configuration with all the modifiers in use:
5757

@@ -76,6 +76,8 @@ const grid = new dhx.Grid("grid_container", {
7676

7777
**Related sample**: [Grid. Clipboard. Financial data with formatted copy/paste](https://snippet.dhtmlx.com/1fnkhwm0)
7878

79-
**Related article:** [Clipboard](grid/configuration.md/#clipboard)
79+
**Related articles:**
80+
- [Clipboard](grid/configuration.md/#clipboard)
81+
- [Work with Clipboard module](grid/usage_clipboard.md)
8082

8183
@changelog: added in v9.2

docs/grid/api/grid_dragpanel_config.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@ The `dragPanel` property can be set in two ways:
5252

5353
- as a *boolean* value it enables or disables the `dragPanel` module upon the component initialization
5454
- as an *object* it enables the module and allows defining additional configuration during initialization:
55-
- `css` - specifies a custom CSS class for styling the drag panel
56-
- `icon` - defines a custom icon for the drag handle
57-
- `width` - sets the width of the drag panel in pixels
55+
- `css` - (*string*) specifies a custom CSS class for styling the drag panel
56+
- `icon` - (*string*) defines a custom icon for the drag handle
57+
- `width` - (*number*) sets the width of the drag panel in pixels
5858

5959
The following example demonstrates configuring the `DragPanel` module with custom styling and width:
6060

@@ -87,7 +87,9 @@ const grid = new dhx.Grid("grid_container", {
8787

8888
**Related sample:** [Grid. DragPanel. Initialization](https://snippet.dhtmlx.com/oyk02cr6)
8989

90-
**Related article:** [Using the DragPanel module](grid/configuration.md/#using-the-dragpanel-module)
90+
**Related articles:**
91+
- [Adjusting DragPanel module](grid/configuration.md/#adjusting-dragpanel-module)
92+
- [Work with DragPanel module](grid/usage_dragpanel.md)
9193

9294

9395
@changelog: added in v9.2

docs/grid/api/grid_history_config.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ const grid = new dhx.Grid("grid_container", {
4242
The `history` property can be set in two ways:
4343
- as a *boolean* value it enables or disables the `History` module upon the component initialization
4444
- as an *object* it enables the module and allows setting additional parameters:
45-
- `limit` - the maximum number of actions stored in the history. When the limit is exceeded, the oldest actions are removed
46-
- `disabled` - if `true`, the module is disabled on initialization, and no actions are recorded in the history
45+
- `limit` - (*number*) the maximum number of actions stored in the history. When the limit is exceeded, the oldest actions are removed
46+
- `disabled` - (*boolean*) if `true`, the module is disabled on initialization, and no actions are recorded in the history
4747

4848
The example below demonstrates configuring the module with a history limit of 10 actions. The module is disabled on initialization:
4949

@@ -68,6 +68,8 @@ grid.history.enable(); // enabling the module
6868

6969
**Related sample:** [Grid. History. Configuration](https://snippet.dhtmlx.com/m88562wf)
7070

71-
**Related article:** [History of Grid actions](grid/configuration.md/#history-of-grid-actions)
71+
**Related articles:**
72+
- [History of Grid actions](grid/configuration.md/#history-of-grid-actions)
73+
- [Work with History module](grid/usage_history.md)
7274

7375
@changelog: added in v9.2

docs/grid/api/grid_rangeselection_config.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ const grid = new dhx.Grid("grid_container", {
4040
@descr:
4141
The `rangeSelection` configuration object can have the following properties:
4242

43-
- **disabled** - makes the module inactive upon initialization of the component
43+
- `disabled` - (*boolean*) makes the module inactive upon initialization of the component
4444

4545
~~~jsx {11,15}
4646
const grid = new dhx.Grid("grid_container", {
@@ -60,6 +60,8 @@ console.log(grid.range.isDisabled()); // -> `true` - module is inactive
6060
grid.range.setRange({ xStart: "a", yStart: "1" }); // the range will not be set
6161
~~~
6262

63-
**Related article:** [Managing RangeSelection in Grid](grid/configuration.md/#managing-range-selection-in-grid)
63+
**Related articles:**
64+
- [Managing RangeSelection in Grid](grid/configuration.md/#managing-range-selection-in-grid)
65+
- [Work with RangeSelection module](grid/usage_rangeselection.md)
6466

6567
@changelog: added in v9.2

docs/grid/configuration.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2185,7 +2185,7 @@ const grid = new dhx.Grid("grid", {
21852185
});
21862186
~~~
21872187
2188-
### Adjusting the DragPanel module
2188+
### Adjusting DragPanel module
21892189
21902190
:::tip Pro version only
21912191
This functionality requires PRO version of the DHTMLX Grid (or DHTMLX Suite) package.
@@ -2234,10 +2234,10 @@ const grid = new dhx.Grid("grid_container", {
22342234
});
22352235
~~~
22362236
2237-
You can specify additional configuration options for the `DragPanel` module while initializing the component. For this, you need to set the `dragPanel` property as an object. The following options are available:
2238-
- `css` - specifies a custom CSS class for styling the drag panel
2239-
- `icon` - defines a custom icon for the drag handle
2240-
- `width` - sets the width of the drag panel in pixels
2237+
You can specify additional configuration options for the `DragPanel` module while initializing the component. For this, you need to set the `dragPanel` property as an *object*. The following options are available:
2238+
- `css` - (*string*) specifies a custom CSS class for styling the drag panel
2239+
- `icon` - (*string*) defines a custom icon for the drag handle
2240+
- `width` - (*number*) sets the width of the drag panel in pixels
22412241
22422242
The following example demonstrates configuring the `DragPanel` module with custom styling and width:
22432243
@@ -2537,7 +2537,7 @@ The `rangeSelection` property can be set in two ways:
25372537
25382538
- as a *boolean* value it enables or disables the range selection module upon the component initialization
25392539
- as an *object* it enables the module and allows setting additional configuration options during the component initialization. The following options are available:
2540-
- **disabled** - makes the module inactive upon initialization of the component
2540+
- `disabled` - (*boolean*) makes the module inactive upon initialization of the component
25412541
25422542
The example below demonstrates interaction with the RangeSelection module's API when range selection is configured to be inactive on the component initialization.
25432543

@@ -2594,19 +2594,19 @@ The `blockSelection` property can be set in two ways:
25942594
<tbody>
25952595
<tr>
25962596
<td><b>disabled</b></td>
2597-
<td>disables the module on startup, `false` by default</td>
2597+
<td>(<i>boolean</i>) disables the module on startup, `false` by default</td>
25982598
</tr>
25992599
<tr>
26002600
<td><b>mode</b></td>
2601-
<td>the operating mode of the module:<ul><li><i>"range"</i> - managed through the <a href="../../usage_rangeselection/">`RangeSelection` module</a></li><li><i>"manual"</i> - managed through the manual control</li></ul></td>
2601+
<td>(<i>string</i>) the operating mode of the module:<ul><li><i>"range"</i> - managed through the <a href="../../usage_rangeselection/">`RangeSelection` module</a></li><li><i>"manual"</i> - managed through the manual control</li></ul></td>
26022602
</tr>
26032603
<tr>
26042604
<td><b>handle</b></td>
2605-
<td>enables the handle for resizing. Can be set as a *boolean* value or as an *object*, `true` by default. <br>As an *object* can contain the following properties:<ul><li><b>allowAxis</b> - restricts the handle movement: `"x"` (horizontal), `"y"` (vertical), `"xy"` (both directions). `"xy"` by default</li><li><b>handler</b> - a *function* to process the handle actions or *boolean* to enable/disable. As a *function*, the property takes the following parameters:</li><ul><li><b>cell</b> - the object of the current cell. Contains the following properties:</li><ul><li>*row* - the configuration object of a row</li><li>*column* - the configuration object of a column</li></ul></ul><ul><li><b>array</b> - an array of all selected cells. Each cell object contains the following properties: </li><ul><li>*row* - the configuration object of a row</li><li>*column* - the configuration object of a column</li></ul></ul><ul><li><b>range</b> - an array of pre-selected cells. Each cell object contains the following properties: </li><ul><li>*row* - the configuration object of a row</li><li>*column* - the configuration object of a column</li></ul></ul><ul><li><b>dir</b> - the direction of cells selection: "up" | "down" | "right" | "left"</li></ul><ul><li><b>index</b> - the index of the iterated cell</li></ul><ul><li><b>grid</b> - the `dhx.Grid` component object</li></ul></ul></td>
2605+
<td>(<i>boolean | object</i>) enables the handle for resizing or provides additional configuration options, `true` by default. As an *object* can contain the following properties:<ul><li><b>allowAxis</b> - (<i>string</i>) restricts the handle movement: `"x"` (horizontal), `"y"` (vertical), `"xy"` (both directions). `"xy"` by default</li><li><b>handler</b> - (<i>function | boolean</i>) a *function* to process the handle actions or *boolean* to enable/disable. As a *function*, the property takes the following parameters:</li><ul><li><b>cell</b> - (<i>object</i>) the object of the current cell. Contains the following properties:</li><ul><li>*row* - the configuration object of a row</li><li>*column* - the configuration object of a column</li></ul></ul><ul><li><b>array</b> - (<i>array</i>) an array of all selected cells. Each cell object contains the following properties: </li><ul><li>*row* - the configuration object of a row</li><li>*column* - the configuration object of a column</li></ul></ul><ul><li><b>range</b> - (<i>array</i>) an array of pre-selected cells. Each cell object contains the following properties: </li><ul><li>*row* - the configuration object of a row</li><li>*column* - the configuration object of a column</li></ul></ul><ul><li><b>dir</b> - (<i>string</i>) the direction of cells selection: "up" | "down" | "right" | "left"</li></ul><ul><li><b>index</b> - (<i>number</i>) the index of the iterated cell</li></ul><ul><li><b>grid</b> - (<i>object</i>) the `dhx.Grid` component object</li></ul>The <b>handler</b> function may return an <i>object with the history of Grid actions</i>. The returned object contains the following properties:<ul><li><b>prev</b> - the previous cell value</li><li><b>current</b> - the new cell value</li></ul></ul></td>
26062606
</tr>
26072607
<tr>
26082608
<td><b>area</b></td>
2609-
<td>enables the display of the selection area, `true` by default</td>
2609+
<td>(<i>boolean</i>) enables the display of the selection area, `true` by default</td>
26102610
</tr>
26112611
</tbody>
26122612
</table>
@@ -2690,9 +2690,9 @@ The `clipboard` property can be set in two ways:
26902690
26912691
- as a *boolean* value it enables or disables the `clipboard` module upon the component initialization
26922692
- as an *object* it enables the module and allows defining [modifier functions](grid/usage_clipboard.md/#using-formatter-functions) for data processing. The following properties are available:
2693-
- `copyModifier` - modifies data before copying to the clipboard. Accepts as parameters the cell value, the cell object, and the `cut` flag (set to `true`, if it's a cut operation)
2694-
- `cutModifier` - modifies the cell data before cutting (before clearing the cell). Accepts as parameters the cell value and the cell object
2695-
- `pasteModifier` - modifies data from the clipboard before pasting into a cell. Accepts as parameters the cell value and the cell object
2693+
- `copyModifier` - (*function*) modifies data before copying to the clipboard. Accepts as parameters the cell value, the cell object, and the `cut` flag (set to `true`, if it's a cut operation)
2694+
- `cutModifier` - (*function*) modifies the cell data before cutting (before clearing the cell). Accepts as parameters the cell value and the cell object
2695+
- `pasteModifier` - (*function*) modifies data from the clipboard before pasting into a cell. Accepts as parameters the cell value and the cell object
26962696

26972697
The example below demonstrates the clipboard configuration with all the modifiers in use:
26982698

@@ -2746,8 +2746,8 @@ const grid = new dhx.Grid("grid_container", {
27462746
The `history` property can be set in two ways:
27472747
- as a *boolean* value it enables or disables the `History` module upon the component initialization
27482748
- as an *object* it enables the module and allows setting additional parameters:
2749-
- `limit` - the maximum number of actions stored in the history. When the limit is exceeded, the oldest actions are removed
2750-
- `disabled` - if `true`, the module is disabled on initialization, and no actions are recorded in the history
2749+
- `limit` - (*number*) the maximum number of actions stored in the history. When the limit is exceeded, the oldest actions are removed
2750+
- `disabled` - (*boolean*) if `true`, the module is disabled on initialization, and no actions are recorded in the history
27512751

27522752
The example below demonstrates configuring the module with a history limit of 10 actions. The module is disabled on initialization:
27532753

0 commit comments

Comments
 (0)