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

Grouping with expansion (default) + external paging. #2157

Open
GipHub123 opened this issue Jul 27, 2023 · 0 comments
Open

Grouping with expansion (default) + external paging. #2157

GipHub123 opened this issue Jul 27, 2023 · 0 comments

Comments

@GipHub123
Copy link

GipHub123 commented Jul 27, 2023

Not sure if is just me doing something wrong or is there a bug with grouping with default expansion?

I also noticed that inputs groupRowsBy and groupExpansionDefault aren't described in current document?
https://swimlane.gitbook.io/ngx-datatable/api/table/inputs

I'm submitting a ... (check one with "x")

[ x] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here, post on Stackoverflow or Gitter

Current behavior

groupExpansionDefault is not respected when page is changed.

Expected behavior

groupExpansionDefault is respected when page is changed.

Reproduction of the problem

1. Set up

  • External paging = true
  • External sorting = true
  • Default expansion = true

<ngx-datatable class="data-table" #table
			   [rows]="data"
               [externalPaging]="true"
               [externalSorting]="true"
               [groupRowsBy]="groupkey"
               [groupExpansionDefault]="true" ...>

2. Steps

  1. When page 0 is show by default -> groupExpansionDefault is respected (all groups are opened)
  2. Click page 1 -> groupExpansionDefault is NOT respected (all groups are closed)
    I tried to debug the code.
    It looked like table?.bodyComponent?.rowExpansions contained groups from page from page 0 -> Updating data does not update this.table?.bodyComponent?.rowExpansions for some reason?

I printed out data's group keys + keys from table?.bodyComponent?.rowExpansions.

Page 0:

data group keys: [ "1", "1", "2", "2", "3"]
row expansions:  [ "1", "2", "3" ]

Page 1:

data group keys: [ "4", "4", "4", "5" ]
row expansions:  [ "1", "2", "3" ]

What is the motivation / use case for changing the behavior?

Please tell us about your environment:

  • Table version:
    "@swimlane/ngx-datatable": "^20.1.0",

  • Angular version:

Angular CLI: 16.1.5
Node: 16.17.0
Package Manager: npm 8.15.0
OS: win32 x64

Angular: 16.1.6
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... platform-server, router

Package                                    Version
--------------------------------------------------------------------
@angular-devkit/architect                  0.1601.5
@angular-devkit/build-angular              16.1.5
@angular-devkit/core                       16.1.5
@angular-devkit/schematics                 16.1.5
@angular/cdk                               16.1.5
@angular/cli                               16.1.5
@angular/google-maps                       16.1.5
@angular/material                          16.1.5
@angular/material-date-fns-adapter         16.1.5
@nguniversal/builders                      16.1.1
@nguniversal/common                        16.1.1
@nguniversal/express-engine                16.1.1
@nguniversal/module-map-ngfactory-loader   v8.2.6
@schematics/angular                        16.1.5
rxjs                                       7.8.1
typescript                                 5.1.6
zone.js                                    0.13.1
  • Browser:
    Tested with Chrome version 115.0.5790.98 (Official Build) (64-bit)

  • Language:
    typescript 5.1.6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant