Perhaps more than once you have wanted to tie two or even more combo boxes together, such as for showing the countries in a continent, states in a particular country, languages within a locale, products within a category, students in a faculty, and so on, such that both of them would load all available data normally. But, if a selection has been made in the parent
Category
combo then the Products
combo should only show products from the selected Category
.
GXT's extensive array of widget lifecycle events can be employed to create this functionality. We can either craft this solution by preloading and populating both combos and then locally filtering the store of the child combo based on the selection made on the parent combo; or we can dynamically configure the loader of the child combo to load items from the server based on the selection made on the parent combo. For this recipe, we'll be opting for the latter solution.