ExtJS Hack: How To Get Selected Index of ExtJS ComboBoxBy Angsuman Chakraborty, Gaea News Network
Monday, August 20, 2007
ExtJS ComboBox doesn’t advertise, in its documentation, any way to get the selected index of a ComboBox. Looking at the code I realized we can use the undocumented property selectedIndex. However there is a catch.
ComboBox.reset() doesn’t set the selectedIndex to -1, which it should. So whenever you use selectedIndex, remember to reset it manually after reset(). Otherwise it will return stale value.