WinJS grouped ListView / multiple Datasources?


  • Hello

    for our win8 APP we need a grouped listview with different templates.

    As far no problem at all, but for each group we have different datasources.


    1) Group with static content (div/container)

    2) Categorylist via xhr (e.g. /categories.php?limit=12)

    3) articlelist via xhr (e.g. /articles.php?start=0&limit=none&offset=20) with incremental loading.

    Is there a possibility to get a datasource for a listView with this 3 different sources?

    THANKS in advance

    Monday, January 21, 2013 2:19 PM

All replies

  • Hi basti13,

    If you want to use single ListView and datasource, I can only think about creating a custom datasource which load the certain data (of the certain group) from the corresponding sources(such as webservice, static xml file...). And you might need to apply grouping on the custom data source, too.

    #How to create a custom data source (Windows Store apps using JavaScript and HTML) (Windows)

    #HTML ListView working with data sources sample

    Or another possible approach is just use separate ListView control, each one load its own data. And you need to put these ListViews side by side on the page so as to simulate the grouping effect of a single ListView.

    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Tuesday, January 22, 2013 6:16 AM
  • approach1:

    As i know it isnt possible to use multiple DataSources for one Listview?

    My Problem is i have 3 sources: 2x xhr, 1x static content.

    So my question is, how can i connect the 3 sources in a single DataSource??


    In my opinion the best way!

    But if i have 3 ListViews side by side i think the scrolling behavior is wrong?

    I want to scroll the whole page but with 3 Listviews i scroll inside each Listview?

    Can i prevent the ListViews to make a scrollbar?

    Other problem is that the last Listview should load its data incremental if i scroll at the end of list...

    Wednesday, January 23, 2013 6:51 AM