From 80afc5127f12ec5046adefc9eff26e45d12575c3 Mon Sep 17 00:00:00 2001 From: Mariela Tihova Date: Thu, 24 Oct 2024 16:23:55 +0300 Subject: [PATCH] Fixed state persistence sample- checking & unchecking options --- .../pivot-grid/state-persistence-main/src/index.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/samples/grids/pivot-grid/state-persistence-main/src/index.ts b/samples/grids/pivot-grid/state-persistence-main/src/index.ts index 86f4132af..f5444f060 100644 --- a/samples/grids/pivot-grid/state-persistence-main/src/index.ts +++ b/samples/grids/pivot-grid/state-persistence-main/src/index.ts @@ -21,7 +21,7 @@ export class Sample { public options: IgcGridStateOptions = { cellSelection: true, - rowSelection: true, + columnSelection: true, filtering: true, sorting: true, expansion: true, @@ -245,13 +245,14 @@ export class Sample { if (action === 'allFeatures') { var allCheckboxes = Array.from(document.getElementsByTagName("igc-checkbox")); allCheckboxes.forEach(cb => { - cb.checked = event.detail; + cb.checked = event.detail.checked; }); + for (const key of Object.keys(this.options)) { - (this.gridState.options as any)[key] = event.detail; - } + (this.gridState.options as any)[key] = event.detail.checked; + } } else { - (this.gridState.options as any)[action] = event.detail; + (this.gridState.options as any)[action] = event.detail.checked; var allFeatures = document.getElementById("allFeatures") as IgcCheckboxComponent; allFeatures.checked = Object.keys(this.options).every(o => (this.gridState.options as any)[o]); }