I am using ng Smarttable and change the datasource array via an event (the change is an id change of a value inside the array). The problem is that angular doesnt detect the changes and nothing happens UNTIL i hover over the page or click somewhere.
So the changes are correctly applied behind the scenes and angular "sees" these changes once i click somewhere.
So i could just manually click alot of times to see the chaning property, but this is not desired.
I tried:
- using ChangeDetectorRef inside the function where i change the array (markAsChanged & DetectChange)
- manually making a click event once the array is changed
- Using Immutability (this.data= [...this.data];)
Is it possible to have something like this?
this.renderer.refresh();
or use just a functionality of ng smartable?
EDIT: it looks like the problem was on my side. When you "refresh" the smarttable,you get a promise which only executes once the loading is finished.
I didnt used the promise. Putting the normal DetectChange() inside the promise made it work
data
array try writing this line in your event listener:this.data = [...this.data]
. – Decal