locked
How can I identify a specific property in a Grip App Template?

    Question

  • I'm developing an App for Windows Store and I have done some changes in the code the first one in data.js:

     var sampleItems = [
                { group: sampleGroups[0], itemClass: "item2", title: "Pupusas:", subtitle: "Item Subtitle: 1", description: itemDescription, content: itemContent, backgroundImage: "/images/dishes/horizontal/comidas.jpg" },
                { group: sampleGroups[0], itemClass: "item", title: "Atol Shuco:", subtitle: "Item Subtitle: 2", description: itemDescription, content: itemContent, backgroundImage: "/images/dishes/thumbnails/bebidas/atol_shuco.jpg" },
                { group: sampleGroups[0], itemClass: "item", title: "Pan con Pollo:", subtitle: "Item Subtitle: 3", description: itemDescription, content: itemContent, backgroundImage: "/images/dishes/thumbnails/comidas/pan_pollo.jpg" },
                { group: sampleGroups[0], itemClass: "item", title: "Nuegados de Huevo:", subtitle: "Item Subtitle: 4", description: itemDescription, content: itemContent, backgroundImage: "/images/dishes/thumbnails/postres/nuegados.jpg" },
                { group: sampleGroups[0], itemClass: "item", title: "Frijoles Borrachos:", subtitle: "Item Subtitle: 5", description: itemDescription, content: itemContent, backgroundImage: "/images/dishes/thumbnails/comidas/frijoles_borrachos.jpg" }];

    As you can see I have added a property called itemClass which one determinate me, the class of CSS that I'm going to use and this is the result:

    I know it works good but my problem is that all the pictures that you see are items and I need that the larges ones must be groups, I have the codes for groups and items for the groupedItem.js although I don't know how to merge them, this are the codes, both must be in the  _initializeLayout: function (listView, viewState) in the else:

    This is for the items:

                    listView.itemDataSource = Data.items.dataSource;
                    listView.groupDataSource = Data.groups.dataSource;

    This is for the groups:

                listView.itemDataSource = Data.groups.dataSource;
                listView.groupDataSource = null;

    I would like to know, how can I identify "item2"? And chose the groups inside of the items.


    Federico Navarrete


    • Edited by FANMixco Wednesday, January 02, 2013 9:27 PM Gramar Mistake
    Wednesday, January 02, 2013 6:26 PM

Answers

  • Hi Federico,

    Can you post the group function you are using? Note that in listviews you can't display grouped and ungrouped items at the same time.
    The group property of the resultant binding list of the createGrouped call will hold the group keys and the item indexes in each one of them.

    Diego.

    • Marked as answer by FANMixco Sunday, February 08, 2015 9:34 PM
    Sunday, January 06, 2013 4:10 PM

All replies

  • Hi Federico,

    Can you post the group function you are using? Note that in listviews you can't display grouped and ungrouped items at the same time.
    The group property of the resultant binding list of the createGrouped call will hold the group keys and the item indexes in each one of them.

    Diego.

    • Marked as answer by FANMixco Sunday, February 08, 2015 9:34 PM
    Sunday, January 06, 2013 4:10 PM
  • Hi Federico,

    Can you post the group function you are using? Note that in listviews you can't display grouped and ungrouped items at the same time.
    The group property of the resultant binding list of the createGrouped call will hold the group keys and the item indexes in each one of them.

    Diego.

    Sunday, January 06, 2013 4:11 PM
  • Hi Federico,

    Can you post the group function you are using? Note that in listviews you can't display grouped and ungrouped items at the same time.
    The group property of the resultant binding list of the createGrouped call will hold the group keys and the item indexes in each one of them.

    Diego.

    Sunday, January 06, 2013 4:11 PM