I must be doing something very wrong. I will greatly appreciate any help anybody can offer.

skirtle

13 Oct 2012, 4:19 PM

You're mixing all sorts of paradigms there. I'm guessing you're using ExtJS 4 so I've moved this thread to the ExtJS 4 Q&A forum.

Why are you doing this in an afterrender listener? Why not just do it when the store loads?

To grab unique values from a store you could use something like:

var values = combobox.getStore().collect('category');

I wouldn't use a config block when defining a model if I were you. That may be the way to do it in Touch but in ExtJS you're asking for trouble. Just specify the config options directly on the class.

This bit appears to be from ExtJS 3:

new Ext.data.Record({value:dstnct[i]})

Ext.data.Record is just an alternative name for Ext.data.Model but you should probably be creating instances of tempComboModel instead (or just passing the record configs to the add method).

This line is a little too optimistic:

abstractcomponent.store = store;

The store is bound to the combobox, updating that single property won't update all of the other stuff like the listeners. To 'update' the store for a combobox the best way is to update the contents of the store rather than trying to change the store itself. You can either clear the contents of the store and add the unique entries or alternatively just purge the duplicates.