Skip to content Skip to sidebar Skip to footer

Linked Comboboxes With One Store In Extjs 4.0

I have 2 comboboxes. The first selects a category, the second selects the sub category. Both categories are stored in one store with fields: id, parentId, label. Filtering the stor

Solution 1:

Instead of referring to the same store use Ext.create() to create a new instance of the same store for the second combo box. Use select or change listeners on comboboxes to trigger filtering from one to the other.

EDIT: Here is an example of such a beast :) http://extjs.wima.co.uk/example/1 This is not mine but sounds exactly what you are doing. Please note the way the stores are setup for each combo box. The first Combo CREATES a new store with the new operator - although this is not the best practice, it will work. The best practice is just to use Ext.create(..).

The second Combo refers to an existing store. In your case since you are reusing the same store definition you want to use Ext.create(...) on both Combos.

For more reference on best practices of class system read this guide: http://docs.sencha.com/ext-js/4-0/#!/guide/class_system

Solution 2:

friend.....try filter on the store.

Post a Comment for "Linked Comboboxes With One Store In Extjs 4.0"