View Full Version : Timefield/Combobox expanded list issue when setting value from loadRecord.

9 Jan 2013, 1:27 AM

When loadRecord sets a timefield value it seems to be an issue with selected item when expanding the list. When first time expanding it has no selected value (lastSelected is not set in selectionModel) and if autoselect is turned on it automaticly selects the first value in the list which is 00:00, but I want it to select the value that is already set in the timefield (set by loadRecord). So when expanding a timefield list it should select the value in the timefield. I guess this is also a problem for comboboxes.

Is this a bug?


9 Jan 2013, 3:34 AM
This seems like a bug in timefield's syncSelection() and combobox doAutoSelect().

The timefields syncSelection method is checking the date value and not the time (hours and min) value. So a fix in syncSelection will solve it.

var recDate = rec.get('date');
if (recDate.getHours() === value.getHours() && recDate.getMinutes() === value.getMinutes())

Also the autoSelect does not work. So you need to call syncSelection after autoSelec (in combobox doAutoSelect).