Open ktersius opened 7 years ago
Hi @ktersius, yeah, this is an issue I am aware of and I will look into it. The reason I did not implement it in the first place is that I was unsure, whether it could harm the performance or not. But as there seems to be a use case, I will evaluate the practicability. Thanks!
Yup, I met the same problem today, but I solved it by this tricky way.
In templates
<od-virtualscroll [vsData]="data$" [vsOptions]="options$">
...
</od-virtualscroll>
In components
data$ = new Subject<number[]>();
change() {
// use this to force redraw
this.data$.next([]);
this.data$.next(new Array(100).fill(0).map(x => Math.floor(Math.random() * 1000)));
}
Yeah thanks. But it's still something, which needs to be addressed in future. I hope I will find some time for another maintenance/feature request round.
Have you had a chance to look into this? I'm facing a similar issue.
Not yet, but I (or someone else :+1:) will!
Currently when options like item sizes are changed I have to somehow force the component to redraw. It seems that emitting the options itself is not enough to trigger any sort of redraw.
If I only emit options they seem to only take effect as I scroll through the items and the rows are updated.
For now I'm emitting an empty array and then right after that the data array, this seems to make it redraw but it feels messy.