Ngx-datatable: Update row column will collapse rowDetail

Created on 27 Feb 2018  路  11Comments  路  Source: swimlane/ngx-datatable

I'm submitting a ... (check one with "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

Collapse rowDetail after column value updated

Expected behavior

Update column value without collapse rowDetail (or not refresh whole table)

Reproduction of the problem

like the example code below
https://stackblitz.com/edit/angular-yvwhus?file=app%2Fapp.component.ts

There is a button call "Austin growup" , after clicking , the Austin's age will change and update table through this.rows = [...this.rows] in function updateTable().

But when I click button after expanding the detail row, the table will refresh and collapse all the rowDetail.

I think the problem is this.rows = [...this.rows]. I believe that will refresh whole table.

so...is there any way to dynamically update one row's value without collapse rowDetail (or without whole table refresh).

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

Please tell us about your environment:

  • Table version: 11.1.7

  • Angular version: 5.1.1

  • Browser: all

  • Language: TypeScript

Most helpful comment

This is the only issue we are facing. This needs to be merged

All 11 comments

Did you find a better solution than to store the expanded Ids and reopen the rows after the refresh?

Is there a timeline of when this will be available?

This is the only issue we are facing. This needs to be merged

The current workaround is not ideal for a couple of reasons:

  • Every time the data is updated, the table flashes since it's collapsing and then expanding the row
  • If you are expanding a large table, it resets the scroll position you had
  • Aside from the fact that you have to keep track of opened and closed rows which is a pain

Ideally you should be able to update the data in a table and not lose your previously expanded rows. Any updates on when this could be merged?

What is the status of this bug and the pull request https://github.com/swimlane/ngx-datatable/pull/1392?

We have components with forms in our rowDetails and if new data is pushed into the rows, the components are re-created and the focus is lost. Without this fix, I think we have to refrain from using rowDetails

@marjan-georgiev Please merge.

@JochenDiekenbrock @DonJuwe Hi, guys. Have this fix worked out? The problem still remains.
@marjan-georgiev Can we please have a release?

Can we get a release? Tested against master and it works great!

@dapullar Hi, David. You said that you have tested the fix and it works great. However I still get lots of problems. I store my data for rows in ngrx store and when the store updates, the changes are pushed through observable and my table collapses even despite the fixes that have been introduced in . Did you tested it with ngrx store or with observables? Thanks a lot

@KaterinaMykhailyk rowIdentity is the anchor that keeps the rows open regardless of what is being used as the update method for the table. As long as the rowIdentity for the target remains static they should not close.

@dapullar thank you very much! You helped me a lot, I spent so much time trying to fix it.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ChanBen picture ChanBen  路  3Comments

id1945 picture id1945  路  3Comments

IngoManthey picture IngoManthey  路  3Comments

Matthi0uw picture Matthi0uw  路  3Comments

JanStock picture JanStock  路  3Comments