Skip to content

Commit

Permalink
fix: initial grid state should also include toggled presets
Browse files Browse the repository at this point in the history
  • Loading branch information
ghiscoding committed Jun 12, 2021
1 parent 87d5c2a commit 2c0cec8
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ declare const Slick: any;

@Injectable()
export class TreeDataService {
private _isLastFullToggleCollapsed = this.gridOptions?.treeDataOptions?.initiallyCollapsed ?? false;
private _isLastFullToggleCollapsed = false;
private _lastToggleStateChange: Omit<TreeToggleStateChange, 'fromItemId'> = {
type: this.gridOptions?.treeDataOptions?.initiallyCollapsed ? 'full-collapse' : 'full-expand',
previousFullToggleType: this.gridOptions?.treeDataOptions?.initiallyCollapsed ? 'full-collapse' : 'full-expand',
Expand Down Expand Up @@ -63,6 +63,9 @@ export class TreeDataService {

init(grid: any) {
this._grid = grid;
this._isLastFullToggleCollapsed = this.gridOptions?.treeDataOptions?.initiallyCollapsed ?? false;
this._currentToggledItems = this.gridOptions.presets?.treeData?.toggledItems ?? [];


// there's a few limitations with Tree Data, we'll just throw error when that happens
if (this.gridOptions?.enableTreeData) {
Expand Down

0 comments on commit 2c0cec8

Please sign in to comment.