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
fix(tree): using initiallyCollapsed change internal toggled state
- if we defined `initiallyCollapsed` as true, we should expect the internal toggle state change to be updated accordingly
- also add extra arguments to the `applyToggledItemStateChanges()` method to skip a full toggle and also another argument to optionally trigger an item toggled event
Copy file name to clipboardExpand all lines: src/app/modules/angular-slickgrid/services/treeData.service.ts
+35-7
Original file line number
Diff line number
Diff line change
@@ -94,8 +94,11 @@ export class TreeDataService {
94
94
* Apply different tree toggle state changes by providing an array of parentIds that are designated as collapsed (or not).
95
95
* User will have to provide an array of `parentId` and `isCollapsed` boolean and the code will only apply the ones that are tagged as collapsed, everything else will be expanded
96
96
* @param {Array<TreeToggledItem>} treeToggledItems - array of parentId which are tagged as changed
97
+
* @param {ToggleStateChangeType} previousFullToggleType - optionally provide the previous full toggle type ('full-expand' or 'full-collapse')
98
+
* @param {Boolean} shouldPreProcessFullToggle - should we pre-process a full toggle on all items? defaults to True
99
+
* @param {Boolean} shouldTriggerEvent - should we trigger a toggled item event? defaults to False
@@ -107,17 +110,42 @@ export class TreeDataService {
107
110
// we first need to put back the previous full toggle state (whether it was a full collapse or expand) by collapsing/expanding everything depending on the last toggled that was called `isLastFullToggleCollapsed`
// typically (optionally and defaults to true) if we want to reapply some toggled items we probably want to be in the full toggled state as it was at the start
120
+
// collapse/expand from the last full toggle state, all the items which are parent items with children
0 commit comments