1. #1
    Sencha User
    Join Date
    Mar 2012
    Posts
    9
    Answers
    1
    Vote Rating
    0
    olafvdg is on a distinguished road

      0  

    Question Unanswered: Can the List component only show unique records?

    Unanswered: Can the List component only show unique records?


    My data contains lots of duplicates on some fileds, now if I only want to show unique records in a list, how can I do that in Sencha Touch 2? See data example below, I just want a category list with two items, 'tools' and 'drinks'.

    Code:
    [
     {category:'tools',name:'hammer'},
     {category:'tools',name:'screwdriver'},
     {category:'drinks',name:'coke'}, 
     {category:'drinks',name:'water'}, 
    ]

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,620
    Answers
    3452
    Vote Rating
    817
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    List component has no logic to discern one record from another other. It's all about your store/model which shouldn't care so can I see your store and model?
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    Mar 2012
    Posts
    9
    Answers
    1
    Vote Rating
    0
    olafvdg is on a distinguished road

      0  

    Default


    Hi Mitchell,

    I am just experimenting with the list example which is included in the Sencha Touch 2 distribution (examples/list).

    The project I need this for will have a store like this:

    Marketing, Water
    Marketing, Coke
    Sales, Beer
    Sales, Water
    Sales, Coke
    Purchasing, Beer
    Purchasing, Coke

    I would like to start of with a list of departments, clicking on an item reveal the 'drinks'. However, when I click a drink I ant to get a list of all departments associated with that drink.

    Don't know if my explanation is clear... ;-)
    Last edited by olafvdg; 13 Mar 2012 at 4:52 AM. Reason: clean up

Thread Participants: 1