Skip to content

Commit 8084ec3

Browse files
committed
[fix] correct descriptions of data/treecollection methods
1 parent 8c9d990 commit 8084ec3

6 files changed

+22
-21
lines changed

docs/data_collection/api/datacollection_foreach_method.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ description: You can explore the forEach method of DataCollection in the documen
1212

1313
@params:
1414
- `callback: function` - a function that will iterate over items of a data collection. The function is called with the following parameters:
15-
- `item` - (required) the object of an item
16-
- `index` - (optional) the index of an item
17-
- `array` - (optional) an array with items
15+
- `item` - the object of an item
16+
- `index` - the index of an item
17+
- `array` - an array of items the method was called upon
1818

1919
@example:
2020
component.data.forEach(function(item, index, array) {

docs/data_collection/api/datacollection_map_method.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ description: You can explore the map method of DataCollection in the documentati
1212

1313
@params:
1414
- `callback: function` - a function that will be called for each item of a component. The function is called with the following parameters:
15-
- `item` - (required) the object of an item
16-
- `index` - (optional) the index of an item
17-
- `array` - (optional) an array with items
15+
- `item` - the object of an item
16+
- `index` - the index of an item
17+
- `array` - an array of items the method was called upon
1818

1919
@returns:
2020
A new array of items where each item is the result of the callback function.
2121

2222
@example:
23-
//getting ids of all items of the component
23+
// getting the ids of all items of the component
2424
component.data.map(function(item, index, array){
2525
return item.id;
2626
});

docs/data_collection/api/datacollection_maprange_method.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ description: You can explore the mapRange method of DataCollection in the docume
1414
- `from: number` - the initial position of an item in the range
1515
- `to: number` - the final position of an item in the range
1616
- `callback: function` - a function that will be called for each item from the specified range. The function is called with the following parameters:
17-
- `item` - (required) the object of an item
18-
- `index` - (optional) the index of an item
19-
- `array` - (optional) an array with items
17+
- `item` - the object of an item
18+
- `index` - the index of an item
19+
- `array` - an array of items the method was called upon
2020

2121
@returns:
2222
A new array of matching item objects.

docs/tree_collection/api/treecollection_foreach_method.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ description: You can explore the forEach method of TreeCollection in the documen
1111
@signature: {'forEach(callback: function, parentID?: string | number, level?: number): void;'}
1212

1313
@params:
14-
- `callback: function` - a function that will iterate over items of a tree collection. It takes three parameters:
14+
- `callback: function` - a function that will iterate over items of a tree collection. It is called with the following parameters:
1515
- `element: object` - the object of an item of a tree collection
1616
- `index: number` - the index of an item
17-
- `array: object[]` - an array with items
17+
- `array: object[]` - an array of items the method was called upon
1818
- `parentID: string | number` - optional, the parent id. If not specified, the function will start iterating over from the root item.
1919
- `level: number` - optional, the number of levels to be iterated over. If not specified, each nested level will be visited.
2020

docs/tree_collection/api/treecollection_map_method.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ description: You can explore the map method of TreeCollection in the documentati
1111
@signature: {'map(callback: function, id?: string | number, direct?: boolean): any;'}
1212

1313
@params:
14-
- `callback: function` - the function that will be applied to every item. The function can take three parameters:
15-
- `item: object` - required, the object of an item
16-
- `index: number` - optional, the index of an item
17-
- `array: object[]` - optional, an array with items
14+
- `callback: function` - the function that will be applied to every item. The function is called with the following parameters:
15+
- `item: object` - the object of an item
16+
- `index: number` - the index of an item
17+
- `array: object[]` - an array of items the method was called upon
1818
- `id: string | number` - the ID of a control the child items of which will be included
1919
- `direct: boolean` - defines whether only direct children of the control will be included in the iteration
2020

@@ -29,17 +29,17 @@ toolbar.paint();
2929

3030
To work with all children of a particular control, pass one more parameter to **map()** - the ID of the control:
3131

32-
~~~js
32+
~~~jsx
3333
toolbar.data.map((item)=>{
3434
// disable items
3535
item.disabled = true;
3636
},"menu_1");
3737
toolbar.paint();
3838
~~~
3939

40-
If you want to iterate only through immediate children, set the third parameter to _false_:
40+
If you want to iterate only through immediate children, set the third parameter to *false*:
4141

42-
~~~js
42+
~~~jsx
4343
toolbar.data.map((item)=>{
4444
// add a css class to each item
4545
item.css = "highlight";

docs/tree_collection/api/treecollection_removeall_method.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,16 @@ description: You can explore the removeAll method of TreeCollection in the docum
66

77
# removeAll()
88

9-
@short: removes all items in the target branch
9+
@short: removes all items in the target branch or all items of the component
1010

1111
@signature: {'removeAll(id: string | number): void;'}
1212

1313
@params:
1414

15-
- `id: string | number` - the id of the branch
15+
- `id: string | number` - (optional) the id of the branch
1616

1717
@example:
1818
toolbar.data.removeAll(id);
1919

2020
@descr:
21+
When called without the parameter, the method removes all items of the component.

0 commit comments

Comments
 (0)