Skip to content

winListView binding doesn't correctly cleanup when user calls ko.cleanNode. #9

@rickwebiii

Description

@rickwebiii

After calling ko.cleanNode on an element with an active winListView binding, the observable array passed as itemDataSource still has _winKoChangesSubscription and _winKoBindingList. If you attempt to rebind this array, to another winjs listview, the observable array and WinJS ListBinding will never synchronize because the subscription to the old ListBinding is still active and on the array.

A proposed fix for this is to call ko.utils.domNodeDisposal.addDisposeCallback on the element with the binding to detect a call to cleanNode. In the callback, you can dispose of the subscription and delete the _winKo members from the observable array.

I'm effectively doing this cleanup in my control's dispose handler as a workaround.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions