Skip to content
This repository was archived by the owner on Jun 1, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/app/examples/grid-tree-data-parent-child.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ <h2>
</button>
<button (click)="reapplyToggledItems()" data-test="reapply-toggled-items-btn"
class="btn btn-outline-secondary btn-sm"
disabled.bind="hasNoExpandCollapseChanged">
[disabled]="hasNoExpandCollapseChanged">
<span class="mdi mdi-history"></span>
<span>Reapply Previous Toggled Items</span>
</button>
<div class.bind="loadingClass"></div>
<div [class]="loadingClass"></div>
</div>
</div>

Expand Down
6 changes: 4 additions & 2 deletions src/app/examples/grid-tree-data-parent-child.component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Component, OnInit, ViewEncapsulation } from '@angular/core';
import { ChangeDetectorRef, Component, OnInit, ViewEncapsulation } from '@angular/core';
import { ExcelExportService } from '@slickgrid-universal/excel-export';

import {
Expand Down Expand Up @@ -49,7 +49,7 @@ export class GridTreeDataParentChildComponent implements OnInit {
hasNoExpandCollapseChanged = true;
treeToggleItems: TreeToggledItem[] = [];

constructor() { }
constructor(private cdref: ChangeDetectorRef) { }

ngOnInit(): void {
// define the grid options & columns and then create the grid itself
Expand Down Expand Up @@ -313,12 +313,14 @@ export class GridTreeDataParentChildComponent implements OnInit {
/** Whenever a parent is being toggled, we'll keep a reference of all of these changes so that we can reapply them whenever we want */
handleOnTreeItemToggled(treeToggleExecution: TreeToggleStateChange) {
this.hasNoExpandCollapseChanged = false;
this.cdref.detectChanges();
this.treeToggleItems = treeToggleExecution.toggledItems as TreeToggledItem[];
console.log('Tree Data changes', treeToggleExecution);
}

handleOnGridStateChanged(gridStateChange: GridStateChange) {
this.hasNoExpandCollapseChanged = false;
this.cdref.detectChanges();

if (gridStateChange?.change?.type === GridStateType.treeData) {
console.log('Tree Data gridStateChange', gridStateChange?.gridState?.treeData);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -323,10 +323,10 @@ describe('Angular-Slickgrid Custom Component instantiated via Constructor', () =
</div>
</div>
<angular-slickgrid
grid-id="grid1"
column-definitions.bind="columnDefinitions"
grid-options.bind="gridOptions"
dataset.bind="dataset">
gridId="grid1"
[columnDefinitions]="columnDefinitions"
[gridOptions]="gridOptions"
[dataset]="dataset">
</angular-slickgrid>`;

beforeEach(async () => {
Expand Down