swimlane / ngx-datatable

✨ A feature-rich yet lightweight data-table crafted for Angular
http://swimlane.github.io/ngx-datatable/
MIT License
4.62k stars 1.68k forks source link

expandAllGroups do not work in row grouping #1338

Open lautarobock opened 6 years ago

lautarobock commented 6 years ago

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 table.groupHeader.expandAllGroups() collapse all groups

Expected behavior should exand all groups.

Reproduction of the problem Here is the example. Just the same as your example of row grouping but adding button for expand and collapse. https://lautarobock.github.io/ngx-datatable-bug-expand-all-groups/

What is the motivation / use case for changing the behavior? I need this feature working

Please tell us about your environment:

Angular CLI: 1.6.0
Node: 6.11.3
OS: win32 x64
Angular: 5.2.9
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

@angular/cli: 1.6.0
@angular-devkit/build-optimizer: 0.0.42
@angular-devkit/core: 0.4.6
@angular-devkit/schematics: 0.0.52
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.9.0
@schematics/angular: 0.1.17
typescript: 2.4.2
webpack: 3.10.0
lautarobock commented 6 years ago

any news?

sbahramy-turner commented 6 years ago

i'm seeing the same. collapseAllGroups() and expandAllGroups() both collapse the groups. Angular 5.2.9, ngx-datatable 11.2.0.


A workaround that I found is to simply re-set your rows data. For example, if your rows input property is set as [rows]="items" then just do "this.items = [...this.items]" in your typescript and this seems to expand all row groups.

Vinoth-deva commented 3 years ago

any news?

Hi, is there any ways to get the row is expanded or collapsed in row grouping?

jtomek commented 2 years ago

A side note: Please make sure that groupRowsBy is not an object! It has to be an id, a name or something stringable & use trackByProp "id", "name" or whatever else you choose ...