How to not rerender all RadListView items

330 Views Asked by At

I see ObservableArray is used in all docs of RadListView and i see not remote datasource example: https://github.com/NativeScript/nativescript-ui-samples-angular/tree/master/listview/src/app/examples

I wonder does ObservableArray plays some big role in not rerendering all items / in updating just one item etc. like in plain angular with *ngFor trackBy only item that changed is rerendered?

Problem is that when i have my list items in state and i update even one item - all items are rerendered and radlistview again becomes slow while it scrolls.

1

There are 1 best solutions below

6
Peter On

Problem is that when i have my list items in state and i update even one item - all items are rerendered and radlistview again becomes slow while it scrolls.

This usually means you're doing something wrong with ObservableArray. When you add an item, use push() and it won't re-render the whole list just a new item should appear. I've been there and could solve the RadListView issues with using ObservableArray as expected.

Please, share a sample here if you need a more specific answer: https://play.nativescript.org/