1. #1
    Sencha User
    Join Date
    Apr 2008
    Posts
    5
    Vote Rating
    0
    doktoreas is on a distinguished road

      0  

    Default ComboBox unique values

    ComboBox unique values


    Hello everybody,
    I have a ComboBox with data coming from a JsonStore.

    A sample of data is this:
    Code:
    var datiCombo = [
            {"Fiume":"Chiascio","Comune":"Gubbio"},
            {"Fiume":"Tevere","Comune":"Perugia"},
            {"Fiume":"Tevere","Comune":"Roma"},
    ];
    If I use the column "Fiume" for my ComboBox, I have got 2 entries "Tevere". Is there a way to populate ComboBox and show only unique values?

    Thank you very much
    Luca

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,604
    Vote Rating
    818
    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


    Best way is not to return them. Try and set it as the idProperty on the Model... see if that works for strings.
    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
    Apr 2008
    Posts
    5
    Vote Rating
    0
    doktoreas is on a distinguished road

      0  

    Default


    Quote Originally Posted by mitchellsimoens View Post
    Best way is not to return them. Try and set it as the idProperty on the Model... see if that works for strings.
    Thanks Mitchell for your answer.
    What do you mean by set it as the idProperty of the mode? Should I access the element and change the list once the page is loaded?

    Thank you for your help
    L.

  4. #4
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,604
    Vote Rating
    818
    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


    http://dev.sencha.com/deploy/touch/d...Ext.data.Model

    Look for the idProperty config. Once again, I haven't used ids that are strings personally.
    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.

Thread Participants: 1

Tags for this Thread