Skip to content

Commit abd622d

Browse files
Merge pull request #106 from DHTMLX/sp-SVAR-2725
[update] clarify parse() as setConfig() alias
2 parents 9def0d1 + c553398 commit abd622d

2 files changed

Lines changed: 23 additions & 4 deletions

File tree

docs/api/methods/js_kanban_parse_method.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,23 @@ description: You can learn about the parse method in the documentation of the DH
1010

1111
@short: Parses data into Kanban
1212

13-
This method performs the same operation as [`setConfig`](/api/methods/js_kanban_setconfig_method) when used with data-related Kanban settings. It is therefore recommended to use `setConfig` for consistency with other configuration options, although `parse` remains supported as an alias for data parsing.
13+
The `parse()` method is an alias for [`setConfig()`](/api/methods/js_kanban_setconfig_method) restricted to data-related properties (`cards`, `columns`, `rows`, `links`). Both methods perform the same operation under the hood for these properties.
14+
15+
:::tip Prefer setConfig()
16+
Use the [`setConfig()`](/api/methods/js_kanban_setconfig_method) method that accepts the same data properties **plus** other Kanban configuration option. Call `setConfig()` once for all props instead of calling `parse()` for data and `setConfig()` for the other props (such as [`columnKey`](api/config/js_kanban_columnkey_config.md), [`rowKey`](api/config/js_kanban_rowkey_config.md), [`cardShape`](api/config/js_kanban_cardshape_config.md)):
17+
18+
~~~js
19+
// instead of two calls
20+
kanban.setConfig({ columnKey: "type" });
21+
kanban.parse({ columns });
22+
23+
// use one
24+
kanban.setConfig({
25+
columnKey: "type",
26+
columns
27+
});
28+
~~~
29+
:::
1430

1531
### Usage
1632

@@ -42,6 +58,9 @@ board.parse({
4258
rows,
4359
links
4460
});
61+
62+
// equivalent call via setConfig()
63+
// board.setConfig({ columns, cards, rows, links });
4564
~~~
4665

4766
**Change log:** Starting from v1.1 you don't need to reset initial data in constructor before parsing new data

docs/howtos.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ In these sections you can find out how to perform operations with cards, work wi
6161
| [Getting cards state](api/internal/js_kanban_getstate_method.md) | Learn how to get the cards state |
6262
| [Getting cards reactive state](api/internal/js_kanban_getreactivestate_method.md) | Learn how to get the cards reactive state |
6363
| [Loading card data](api/config/js_kanban_cards_config.md) | Learn how to load the initial card data |
64-
| [Parsing card data](api/methods/js_kanban_parse_method.md) | Learn how to parse the card data |
64+
| [Loading card data dynamically](api/methods/js_kanban_setconfig_method.md) | Learn how to load card data at runtime via `setConfig()` (or its alias [`parse()`](api/methods/js_kanban_parse_method.md))|
6565
| [Serializing card data](api/methods/js_kanban_serialize_method.md)| Learn how to serialize the card data ([Example](https://snippet.dhtmlx.com/61crsls3?tag=kanban))|
6666
| [Updating card data](api/methods/js_kanban_updatecard_method.md)| Learn how to update the card data |
6767

@@ -117,7 +117,7 @@ In these sections you can find out how to perform operations with columns and wo
117117
| [Getting columns state](api/internal/js_kanban_getstate_method.md) | Learn how to get the columns state |
118118
| [Getting columns reactive state](api/internal/js_kanban_getreactivestate_method.md) | Learn how to get the columns reactive state |
119119
| [Loading column data](api/config/js_kanban_columns_config.md) | Learn how to load the initial column data |
120-
| [Parsing column data](api/methods/js_kanban_parse_method.md) | Learn how to parse the column data |
120+
| [Loading column data dynamically](api/methods/js_kanban_setconfig_method.md) | Learn how to load column data at runtime via `setConfig()` (or its alias [`parse()`](api/methods/js_kanban_parse_method.md))|
121121
| [Serializing column data](api/methods/js_kanban_serialize_method.md)| Learn how to serialize the column data |
122122
| [Updating column data](api/methods/js_kanban_updatecolumn_method.md)| Learn how to update the column data |
123123

@@ -143,7 +143,7 @@ In these sections you can find out how to perform operations with rows and work
143143
| [Getting rows state](api/internal/js_kanban_getstate_method.md) | Learn how to get the rows state |
144144
| [Getting rows reactive state](api/internal/js_kanban_getreactivestate_method.md) | Learn how to get the rows reactive state |
145145
| [Loading row data](api/config/js_kanban_rows_config.md) | Learn how to load the initial row data |
146-
| [Parsing row data](api/methods/js_kanban_parse_method.md) | Learn how to parse the row data |
146+
| [Loading row data dynamically](api/methods/js_kanban_setconfig_method.md) | Learn how to load row data at runtime via `setConfig()` (or its alias [`parse()`](api/methods/js_kanban_parse_method.md))|
147147
| [Serializing row data](api/methods/js_kanban_serialize_method.md)| Learn how to serialize the row data |
148148
| [Updating row data](api/methods/js_kanban_updaterow_method.md) | Learn how to update the row data |
149149

0 commit comments

Comments
 (0)