locked
ListView grouped by Tags (items in many groups)

    Question

  • I have data that can be tagged, I would like to allow the user to sort the main gridview by tags so that they can see all of the tags (as groups) and all of the items that have that tag... I know that Group Projections require item groups to be deterministic and have a single value.. I was wondering if there were any know sample workarounds. ListView for the tags as the groups with embedded ListViews of items for instance? Or perhaps a custom Group Projection that solves the issue in a different way..

    If there isn't a work around and/or its considered "bad" design I am open to other ways of sorting and grouping...

    Thanks

    Josh

    Friday, August 24, 2012 3:00 AM

Answers

  • OK, I understand.  No... there is not standard way to handle inclusion in more than one group.  Some people have chosen to duplicate the data so even though Item 1 in Tag 1 appears the same as Item 1 in Tag 3,  The Tag 3 item is really a copy of Item 1 with the Tag 3 that gets it grouped in there. 

    Jeff Sanders (MSFT)

    Friday, August 24, 2012 8:37 PM
    Moderator

All replies

  • Hi Josh,

    I am not sure I totally follow your 'Tag' analogy.  Can you tell me a little more about that and what you are trying to accomplish?  (Maybe some beautiful illustrations :-) ).

    -Jeff


    Jeff Sanders (MSFT)

    Friday, August 24, 2012 7:11 PM
    Moderator
  • I have documents with Meta-data one of the fields is "tags" (like a blog tag, or a tag used on stackoverflow). I want to group my list of documents by tags.. So the ListView would show. So the documents can have multiple tags and tags can have multiple documents (many to many) so for instance the ListView might look like.

    [Tag 1]                                   [Tag 2]                      [Tag 3]

    [item1]   [item4]                     [item1]                      [item3]

    [item2]   [item5]                     [item6]                      [item4]

    [item3]                                                                    [item6]

    Hopefully that helps describe the intended behavior... I know that all the standard Bindings.List methods and techniques won't work they are all Item centric, and really we are looking at a group centric problem... At this point I am going to dynamicly stack ListViews next to each other, but before I go down that rabbit hole I figured I would ask if there was a better approach or a best practice or suggestion on how to represent these kinds of many to many organizations.

    Josh

    Friday, August 24, 2012 8:31 PM
  • OK, I understand.  No... there is not standard way to handle inclusion in more than one group.  Some people have chosen to duplicate the data so even though Item 1 in Tag 1 appears the same as Item 1 in Tag 3,  The Tag 3 item is really a copy of Item 1 with the Tag 3 that gets it grouped in there. 

    Jeff Sanders (MSFT)

    Friday, August 24, 2012 8:37 PM
    Moderator
  • AHH, ya, not pleasant on memory but my View Models are pretty small... Thanks

    Josh

    Saturday, August 25, 2012 2:37 AM
  • Duplicating or Proxy objects are the only way, cause the grouping functionality of the WinJS Listview is fairly limited.

    I used proxy objects that just reference the real object. Its not a big memory hit.

    Wednesday, August 29, 2012 11:46 AM