Results 1 to 4 of 4

Thread: ComboBox unique values

  1. #1
    Sencha User
    Join Date
    Apr 2008
    Posts
    5
    Vote Rating
    0
      0  

    Default 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 - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,551
    Vote Rating
    1271
      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 @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  3. #3
    Sencha User
    Join Date
    Apr 2008
    Posts
    5
    Vote Rating
    0
      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 - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,551
    Vote Rating
    1271
      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 @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •