locked
Force listview to rerender specific item

    Question

  • The only way to get the LV to rerender an item is to call the setAt method on its backing datasource (BindingList).

    The list.notifyMutated does nothing. How can I force the LV to update a specific item?

    Tuesday, October 02, 2012 10:34 AM

All replies

  • I always thought that listview items are live. When the datasource changes, the items should automatically update.

    To change the listView data you must change the data in the datasource.
    notifyMutated would only notify the listeners, that something has changed in the list at the specified index, but I don't think it is even required for the ListView to update.

    Cheers,

    Censored

    Wednesday, October 03, 2012 5:26 PM
  • My datasource is a Binding.List and my items are observables (Binding.as()). However, changes in the items do not reflect in the listview. I am not talking about adding/removing items but property changes of items.

    I also found the docs for Binding.List missing crucial ctor arguments like {binding:true}.

    I am currently compiling a sample to demonstrate data binding with listview, as there seems to be no sample around. I have yet to find the best way to convert a ordinary WinJS.Class into an observable object without having the class to know beforehand that it will be an observable later on.

    Wednesday, October 03, 2012 9:07 PM