Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Grid] Selection Aggregate does not work when binding GridDataResult #4265

Open
mbechev opened this issue Apr 2, 2024 · 0 comments
Open

Comments

@mbechev
Copy link
Contributor

mbechev commented Apr 2, 2024

Describe the bug
When binding the Grid to a GridDataResult object, the selection aggregates aren't calculated. Only count is available.

This limitation comes from the fact that GridDataResult is an object with two properties, whereas the selection aggregates logic relies on arrays.

see selection.aggregate.service.ts file:

    public init(): void {
        if ((this.ctx.grid.selectable as SelectableSettings).cellAggregates) {
            this.data = this.dataChanges.data ? this.dataChanges.data : this.ctx.grid.data;
             ...
        }
    }

this.ctx.grid.data requires one more level deep to access the actual collection (this.ctx.grid.data.data).

To Reproduce
Select a range of cells.
https://stackblitz.com/edit/angular-ygxfpt-nj5g7l?file=src%2Fapp%2Fapp.component.ts

Possibly related to #4201

@mbechev mbechev changed the title [Grid] Selection Aggregate doesn not work when binding GridDataResult [Grid] Selection Aggregate does not work when binding GridDataResult Apr 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant