PDA

View Full Version : Ext grid with two selects related



erich93063
19 Sep 2011, 12:22 PM
Has anyone successfully created an editable grid where there is one choice based on the selection of another? In other words one field in the editable grid is a combo box and when you make a selection, the values in another combo box will only be values relating to the choice of the first combo box? For example, select a state and then for city you get a combo box of cities only for the state selected. This is in a grid not a normal form so the combo boxes are the edit renderers for the fields.

Ash2009
19 Sep 2011, 5:50 PM
This is how i did it. you need to add a event handler for "afteredit" in the grid which fires after a cell is edited.
check for the first combo value in the "afteredit" listener of the grid. and populate the other combo accordingly.
check the api for more details. u need to check if the field is the first combo,since afteredit will fire for all the cells that got edited.