carbon-design-system / carbon

A design system built by IBM
https://www.carbondesignsystem.com
Apache License 2.0
7.76k stars 1.8k forks source link

Datatable expandable rows don't update on sort #1273

Closed cyrusfurtado closed 5 years ago

cyrusfurtado commented 5 years ago

Detailed description

On sorting a Datatable with expandible rows. The markup for the inner expandible child rows do not get updated upon calling refreshRows() on the table instance.

Is this issue related to a specific component? Yes, http://www.carbondesignsystem.com/components/data-table/code

What did you expect to happen? Expected the markup within the expandable rows to get updated with all angular bindings working What happened instead? I see the same old markup within expandable rows before the sort in the UI What would you like to see changed? The table should get updated with the sorted expandable row markup as well.

What browser are you working in? firefox, chrome

What version of the Carbon Design System are you using? "carbon-components": "^9.8.4"

What offering/product do you work on? Any pressing ship or release dates we should be aware of? BDS dashboard

Steps to reproduce the issue

  1. Instantiate the table with an array of data with expandible rows
  2. Sort the array
  3. Call tableInstance.refreshRows() to update the UI

Additional information

Added link here. This is an angular 5 app btw.

Add labels

Please choose the appropriate label(s) from our existing label list to ensure that your issue is properly categorized. This will help us to better understand and address your issue.

cyrusfurtado commented 5 years ago

Have made a temporary fix for this. Since i need to modify files installed directly by npm might probably need to have the entire carbon-components repo locally available in my src folder for now.

asudoh commented 5 years ago

Hi 👋 thank you for the update - You don't need to modify Carbon code directly for your temporary fix. You can do something like below instead:

import { DataTableV2 } from `carbon-components`;

class MyDataTableV2 extends DataTableV2 {
  refreshRows() {
    (Your code for refreshRows())
  }
}

...

MyDataTableV2.create(myTableElement);

Hope this helps!

cyrusfurtado commented 5 years ago

Thanks for the update.

On Wed, Oct 17, 2018 at 5:07 PM Akira Sudoh notifications@github.com wrote:

Hi 👋 thank you for the update - You don't need to modify Carbon code directly for your temporary fix. You can do something like below instead:

import { DataTableV2 } from carbon-components; class MyDataTableV2 extends DataTableV2 { refreshRows() { (Your code for refreshRows()) } } ... MyDataTableV2.create(myTableElement);

Hope this helps!

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/IBM/carbon-components/issues/1273#issuecomment-430594217, or mute the thread https://github.com/notifications/unsubscribe-auth/Ak1EhQYmSqFMxnCSQDmWHymVuIgPci_rks5ulxaQgaJpZM4XjZBd .