ngx-datatable icon indicating copy to clipboard operation
ngx-datatable copied to clipboard

Body cell with component in template does not check for updates after row is removed

Open benniaminn opened this issue 7 years ago • 4 comments

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

I have a ngx datatable, with a column named 'active'. This column contains a component that receive the column property, displays it, and contains a button to change the property.

  <ngx-datatable-column name="active" prop="active">   
       <ng-template let-value="value" let-row="row" ngx-datatable-cell-template>
        value: {{value}}; 
        row.active: {{row.active}}
        <active-component [value]="value" (changed)="onStateChanged(row, $event)">
        </active-component>
       </ng-template>
 </ngx-datatable-column>

The active component has a button that changes the 'active' field value and emits the 'changed' event with the new value. In the onStateChanged function set the new value to the row and I remove the row that was changed and set the datasource of the table with the new collection. (I have a filter by active value)

After the row is removed, the cell containing the button is not refreshed (it shows the value of the removed line).

I made a plnkr with the example. On version 10.0.2 it works fine when removing the row.

On version 10.0.3 (after performance improvements) it does not update the cell. https://embed.plnkr.co/DmHUI6FhH0nALbwfnuRl/

Is is possible to force the table to recheck/refresh/recalculate the changes?

Thank you, Ben

  • Table version: 10.3.0 (the issue started with 10.0.3)

  • Angular version: 4.2.4

  • Browser: [all]

  • Language: [TypeScript]

benniaminn avatar Nov 01 '17 12:11 benniaminn

I've got same issue

hatung avatar Dec 28 '17 03:12 hatung

I just reported what appears to be the same issue. With example. #1645 I'm just really surprised that nobody seems to have run into this issue before now.

Sharondio avatar Feb 11 '19 22:02 Sharondio

+1 I have the same issue with custom cell template

vooda-- avatar Oct 13 '19 06:10 vooda--

Have the same issue, does anyone got fix for this?

nbhusarapu avatar Mar 31 '22 08:03 nbhusarapu