1. #1
    Sencha User
    Join Date
    Sep 2011
    Posts
    2
    Vote Rating
    0
    rhmorgan is on a distinguished road

      0  

    Default Getting distinct values into a combobox

    Getting distinct values into a combobox


    OK I am an extjs beginner. I have loaded up a store which I want to use for a grid. I also want to have combo boxes above the grid which filter the data. I want to use the same store to build the combo boxes; however, I cannot seem to be able to figure out how to remove the duplicate values. How do I get distinct id, name values from the store into the combobox? thanks to anyone who can help.

  2. #2
    Ext JS Premium Member gevik's Avatar
    Join Date
    May 2009
    Location
    The Netharlands
    Posts
    266
    Vote Rating
    9
    gevik will become famous soon enough

      0  

    Default


    I assume your combobox is not part of the grid columns. What you could do is to implement one of the "before*" events of the combobox (I guess beforequery or expand), then use the store's "each" function and loop the store records to make a distinct list for your combobox.

    I hope this helps.

    BTW: Here is a very good guide if you are new to using the combobox component:
    http://skirtlesden.com/articles/extjs-comboboxes-part-1

    I
    hope this helps.

Thread Participants: 1