0
votes

I'm using X-editable with ngx-datatable on Angular 6 and it's working well, but there is one problem which I can't solve...After updating field with X-editable attached, a new value appears and it's like attached to datatable row index instead of row.id, and when sorting the table, this value is in a row in which it was in the beginning... don't know, that the issue is on X-editable or ngx-datatable or there is problem with my implementation


ok. I solve this with the help from variable which I'm using to check if data is ready, and only then I display datatable... in this case, I did it this way:

onUpdate() {
  this.loading = true

  {....} saving

  setTimeout(() => {
    this.loading = false
  }, 0);

}

in template

<ngx-datatable *ngIf="!loading"></ngx-datatable>

datatable is reloaded and X-editable also

1

1 Answers

0
votes

I can't see your code how you implemented this... but I have a non angular version of this in production now and I ran into the same issue... After update the table still filters on the old data. This is because you must update that row's data on update with the new value. This will allow the datatable to sort on the new value.