The directive `kendoGridColumnChooserTool` does not work correctly when having columns which are grouped. See this example: https://stackblitz.com/edit/angular-r9duqpcn?file=src%2Fapp%2Fapp.component.ts
import { Component } from '@angular/core';
import { FormsModule } from '@angular/forms';
import {
KENDO_GRID,
KENDO_GRID_EXCEL_EXPORT,
KENDO_GRID_PDF_EXPORT,
} from '@progress/kendo-angular-grid';
import { KENDO_TOOLBAR } from '@progress/kendo-angular-toolbar';
import { KENDO_LABELS } from '@progress/kendo-angular-label';
import { KENDO_INPUTS } from '@progress/kendo-angular-inputs';
import { KENDO_BUTTONS } from '@progress/kendo-angular-buttons';
import { Product } from './model';
import { products } from './products';
@Component({
selector: 'my-app',
standalone: true,
imports: [
FormsModule,
KENDO_GRID_EXCEL_EXPORT,
KENDO_GRID_PDF_EXPORT,
KENDO_GRID,
KENDO_BUTTONS,
KENDO_TOOLBAR,
KENDO_LABELS,
KENDO_INPUTS,
],
template: `
<kendo-grid
[kendoGridBinding]="products"
[pageSize]="5"
[pageable]="true"
[sortable]="{ mode: 'multiple' }"
[style.width.%]="gridWidth"
>
<ng-template kendoGridToolbarTemplate position="bottom">
<kendo-grid-column-chooser></kendo-grid-column-chooser>
</ng-template>
<kendo-toolbar overflow="scroll">
<kendo-toolbar-button kendoGridColumnChooserTool></kendo-toolbar-button>
</kendo-toolbar>
<kendo-grid-column-group title="TestA">
<kendo-grid-column
field="ProductName"
title="Product Name"
></kendo-grid-column>
</kendo-grid-column-group>
<kendo-grid-column-group title="TestB">
<kendo-grid-column
field="UnitPrice"
filter="numeric"
title="Price"
></kendo-grid-column>
<kendo-grid-column
field="Discontinued"
filter="boolean"
title="Discontinued"
></kendo-grid-column>
<kendo-grid-column
field="UnitsInStock"
filter="numeric"
title="Units In Stock"
></kendo-grid-column>
</kendo-grid-column-group>
</kendo-grid>
`,
styles: [
`
.example-info {
background: rgba(83, 146, 228, 0.1);
border-radius: 2px;
margin: 10px auto 10px auto;
padding: 15px;
border-left: 4px solid #5392e4;
font-size: 14px;
}
`,
],
})
export class AppComponent {
public gridWidth: number = 100;
public products: Product[] = products;
}
Hello,
When I try to delete all grouping manually by setting an empty group array, datas are disappearing. The grid datas are empty but reappears if I set grouping again. Also I could see data if I scroll down but I can't see any if I haven't enough lines to do so.
In attachment you could find a demo based on the "Collapse All with Grouping" tutorial.
First of all, thank you for providing the state management feature. For me it's one of the most important features of a grid component.
But unfortunately it fails to restore the columns state. This is because each time a grid component and it's columns are instantiated, new IDs are created for the columns. When loading state the columns are identified by their IDs.
When a column is persisted with e.g. id 'k-grid-column-1' and the grid will be destroyed and re-created, then the new column ID is not identical with the old one. Thus restoring the column's state will fail.
Please have a look to this StackBlitz example: https://stackblitz.com/edit/angular-vauqyshn?file=src%2Fapp%2Fapp.component.ts
A possible workaround is to save also the column's field property and later use it to re-map the saved id to the new id.
A better solution may be to extend the GridColumnComponent with something like a "PersistenceKey" property, which will be used for identifying a column. A directive may also work. Otherwise generating non transient unique ids for the grid columns will also work.
Best regards,
Holger
Please provide an option to expand row axes by default. The functionality should allow rendering the row axes expanded just as if they were expanded by clicking on their expand arrow.
Thank you.