Creating a master-details view with a combo box and a grid
Here's another way of displaying related information in a master-details type of view. In this example, a ComboBox
component displays a list of movie categories that control the movies list displayed on the GridPanel
component.
How to do it...
1. Create the data store for the combo box:
var categoriesStore = new Ext.data.JsonStore({ url: 'grid-combo-cascading.php', root: 'categories', baseParams: { action: 'categories' }, fields: ['category_id', 'name'] });
2. Create the data store for the grid:
var moviesStore = new Ext.data.JsonStore({ url: 'grid-combo-cascading.php', root: 'movies', totalProperty: 'count', baseParams: { action: 'movies' }, fields: ['id', 'title', 'category', 'rating', { name: 'length', type: 'int' }, { name: 'price', type: 'float'}] });
3. Define the categories combo box:
var categoriesCombo = { xtype: 'combo', store: categoriesStore, displayField: 'name', valueField: 'category_id', editable: false, mode: 'remote...