locked
Alternative way to grouped listviews with more than 10000 list items

    Question

  • The current logic of the listview is confusing. It asks the datasource to specify where in the list of all items a certain group starts. For that it also requires that the items in the list are already ordered. Also there is no grouping with an unknown number of items in the list.

    Is there a more logical way to specify grouping data sources in such a way that each group has a list of items and you give the listview just a list of groups.

    For each group there is a list of items. When the listview scrolls, it knows which groups are currently visible and asks the group for its items. There is no one monolithic list of ordered items where the groups are just start indexes into. 

    The way the listview works right now, its not possible to manage more than a couple of hundred items, let alone insertions and deletions. Lets say I want to add an item that should appear in several groups. How would I do that with the current listview implementation?

    Does that make any sense? ;)

    Friday, July 13, 2012 5:31 PM

Answers

  •  Lets say I want to add an item that should appear in several groups. How would I do that with the current listview implementation?

    Hi

    Do you mean if you have this data

    var myList = new WinJS.Binding.List([
        { title: "AB" },
        { title: "AC" },
        { title: "BA" }]);

    You want get all the element contain the groupkey to a group like this?

    Group A:

    AB AC BA

    Group B:

    AB BA

    For my understanding you can not do that if you use list.createGrouped(), because the groupData method only excute after the group have been created. And the groupKey() must always return the same results, given the same inputs.

    • Marked as answer by Dino He Friday, July 20, 2012 10:04 AM
    Monday, July 16, 2012 11:50 AM

All replies

  •  Lets say I want to add an item that should appear in several groups. How would I do that with the current listview implementation?

    Hi

    Do you mean if you have this data

    var myList = new WinJS.Binding.List([
        { title: "AB" },
        { title: "AC" },
        { title: "BA" }]);

    You want get all the element contain the groupkey to a group like this?

    Group A:

    AB AC BA

    Group B:

    AB BA

    For my understanding you can not do that if you use list.createGrouped(), because the groupData method only excute after the group have been created. And the groupKey() must always return the same results, given the same inputs.

    • Marked as answer by Dino He Friday, July 20, 2012 10:04 AM
    Monday, July 16, 2012 11:50 AM
  • That's what I'm saying. The Listview has only very limited way of handling grouped items. I would go even so far and say that is has no real world use case for grouped items. It works well in the simple Sample apps but once it gets more complex you would have to roll your own control.

    Imagine a simple picasa like app where a photo can have multiple tags. And you want to group photos by tags. Not possible with the Listview control. Let alone when you have more than say 100 photos. To build the groups you would have to know where each group starts within the item list.

    Monday, July 16, 2012 11:54 AM
  • Hi

    I will close this thread and send your feedback to dev team.

    Thanks for your valuable feedback.

    Friday, July 20, 2012 10:04 AM
  • The more we try to understand how the listview works the more it seems clear that it was never intended to handle 10000 of items with changes/updates/deletes properly. Creating a custom datasource does not help so far. The listview seems to be great for static RSS feed display only so far. 

    Have you got any feedback from the dev team yet?

    Tuesday, July 31, 2012 8:40 AM