I'm struggling with the "New" list view after using the old version successfully for a while.
We have editable fields in the containers of the list view. The idea is to have a variable number of input. In the case I'm working on, it is just two numbers.
However, it is important we can add and delete from this list, and of course we need to keep the visuals in sync with our representative data. This doesn't seem possible.
I cannot find a way to iterate through the controls of the listview and get all of the values. Using
listview.data gives us the data source, which does not match the current values in the controls. In the old list view, we could access the controls in the list as an array:
numberInput[i].value would give us the value in the control of the ith item in the list view. This doesn't seem to work with new list view.
There seem to be some caching and reusing of controls that leads to the wrong default values. For example, if I delete an item from the data source, the list view updates and I can get it to update properly (with some struggles). However, if I then add a new entry to the data source, a new container is added to the end with whatever data was in the previously deleted item, which does not match the data source! I cannot get newly added items to display correct values consistently.