Results 1 to 4 of 4

Thread: Retrieving duplicate value from Json file into ComboBox

  1. #1
    Sencha User
    Join Date
    Jan 2012
    Posts
    36
    Vote Rating
    0
      0  

    Default Answered: Retrieving duplicate value from Json file into ComboBox

    Hi,

    I am trying to remove duplicate value from ComboBox which is loading the data from Json file for a particular column.

    Unfortunately I am unable to solve this one.

    Can anyone give me the solution for this ?

    Thanks in advance.....................

  2. Code:
    var hash = {};
    var value;
    store.each(function(record){
        value = record.get('field');
        if(hash[value]) store.remove(record);
        hash[value] = true;
    })

  3. #2
    Sencha User
    Join Date
    Jan 2012
    Posts
    1,376
    Answers
    347
    Vote Rating
    116
      0  

    Default

    Code:
    var hash = {};
    var value;
    store.each(function(record){
        value = record.get('field');
        if(hash[value]) store.remove(record);
        hash[value] = true;
    })

  4. #3
    Sencha User
    Join Date
    Jan 2012
    Posts
    36
    Vote Rating
    0
      0  

    Default

    Thanks vietits,,

    I got your statements.
    I was trying to implement this code in button handler because when I click on the button the value will be populated into the combo box but not the duplicate value.
    But it was showing duplicate values

    Can you give some hint that where I should implement the code ?

    Thanks.............

  5. #4
    Sencha User
    Join Date
    Jan 2012
    Posts
    1,376
    Answers
    347
    Vote Rating
    116
      0  

    Default

    @Sneha004,

    I am not sure to clearly understand your request. Do you mean the data you load to combobox is not duplicated but it shows the duplicated values? If so, try to remove the old data from the combobox before loading the new one.

Posting Permissions

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