How to chain filteredList and groupedList? RRS feed

  • Question

  • I have this basic setup:

    baselist = WinJS.Binding.List(items)
    filteredList = baselist.createFiltered(function(item) {
      filter.value === "" || item.name.indexOf(filter.value) >= 0
    groupedList = filteredListe.createGrouped(...)
    listview.itemDataSource = groupedList.dataSource
    listview.groupDataSource = groupedList.groups.dataSource

    filter is an input element with an oninput handler attached.

    The listview does not contain any items with this chain.

    Also: How would I refresh the whole list chain, when the user enters new text in the filter input field? I am currently doing a baselist.notifyReloaded, but that seems a bit over the top, isn't it?

    Monday, April 7, 2014 8:00 AM

All replies

  • 1) I don't know what your first question is.

    2) I'm not sure why baselist.notifyReloaded is over the top.  It seems to describe exactly what you want to do.

    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Tuesday, April 8, 2014 7:03 PM
  • Hehe, sorry the first question would have been , why are there no items in the listview with that filter chain.
    Tuesday, April 8, 2014 7:10 PM