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 d63f387 commit f1fe39f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/common/src/services/treeData.service.ts
Expand Up @@ -24,7 +24,7 @@ import { SortService } from './sort.service';
declare const Slick: SlickNamespace;

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 @@ -76,6 +76,8 @@ export class TreeDataService {

init(grid: SlickGrid) {
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 f1fe39f

Please sign in to comment.