Skip to content

Commit 09d665c

Browse files
committed
[update] map, mapRange data collection methods, removeAll tree collection method
1 parent c277b4a commit 09d665c

File tree

4 files changed

+20
-10
lines changed

4 files changed

+20
-10
lines changed

docs/data_collection/api/datacollection_foreach_method.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ description: You can explore the forEach method of DataCollection in the documen
1111
@signature: {'forEach(callback: (item: object, index?: number, array?: object[]) => any): void;'}
1212

1313
@params:
14-
- `callback: function` - a function that will iterate over items of a data collection. The function takes three parameters:
14+
- `callback: function` - a function that will iterate over items of a data collection. The function is called with the following parameters:
1515
- `item` - (required) the object of an item
1616
- `index` - (optional) the index of an item
1717
- `array` - (optional) an array with items

docs/data_collection/api/datacollection_map_method.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,21 @@ description: You can explore the map method of DataCollection in the documentati
88

99
@short: iterates through all items of the component
1010

11-
@signature: {'map(callback: function): object[];'}
11+
@signature: {'map(callback: (item: object, index?: number, array?: object[]) => any): object[];'}
1212

1313
@params:
14-
- `callback: function` - a function that will be called for each item of a component
14+
- `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
1518

1619
@returns:
1720
A new array of items where each item is the result of the callback function.
1821

1922
@example:
2023
//getting ids of all items of the component
2124
component.data.map(function(item){
22-
return item;
25+
return item.id;
2326
});
2427

2528
@descr:

docs/data_collection/api/datacollection_maprange_method.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,17 @@ description: You can explore the mapRange method of DataCollection in the docume
66

77
# mapRange()
88

9-
@short: returns a new array of the items correspond to the specified parameters
9+
@short: returns a new array of the items according to the specified parameters
1010

11-
@signature: {'mapRange(from: number, to: number, callback: function): object[];'}
11+
@signature: {'mapRange(from: number, to: number, callback: (item: object, index?: number, array?: object[]) => any): object[];'}
1212

1313
@params:
1414
- `from: number` - the initial position of an item in the range
1515
- `to: number` - the final position of an item in the range
16-
- `callback: function` - a function that will be called for each item from the specified range
16+
- `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
1720

1821
@returns:
1922
A new array of matching item objects.

docs/tree_collection/api/treecollection_removeall_method.md

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

77
# removeAll()
88

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

11-
@signature: {'removeAll(): void;'}
11+
@signature: {'removeAll(id: string | number): void;'}
12+
13+
@params:
14+
15+
- `id: string | number` - the id of the branch
1216

1317
@example:
14-
toolbar.data.removeAll();
18+
toolbar.data.removeAll(id);
1519

1620
@descr:

0 commit comments

Comments
 (0)