Custom UI Control in RadListView with DataBinding - Property set is called twice

nativescriptcore
plugins
databinding

#1

Hi community. I’m new here, and i’m new to nativeScript. While I’m discovering a lot, i found a problem i cannot solve on my own, so i’m hopping to find some help here.

Therefor i created a playground to easily follow my steps:

I have a viewmodel with an array (items) that i want to show as a gridlist. So i use a RadListView. As item i want to use a custom Ui control which I created (Item). This Item has also a property called “item” (Sorry for naming). In xml of home-page i pass the {{$value}}. For better understanding i put a console.log to the set method of the property.

So whats happening: The set method is called twice for every item: first with the whole ViewModel-Object (i guess) and secondly with the real entry from the Array.

There are two questions now: Why is that happening? Is it a bug or did I make a mistake?

Thanks for helping me.


#2

It may be a bug, I’m not sure as the component is not open source. You may raise a issue in the feedback repo.