I can tell you what the sencha support told for that one year ago:
Well, event is, by definition, a function call triggered by a user
action and there's no user action when you call select.
Anyway, the "fix" is easy: you know that you call select so just after
calling select you can call your select listener function.
It depends on your case what you should do. For me I hanged my implementation so that I was able to call re responsible method but on the other hand I don't see any downside when you fire the event yourself. So I think it is up to you which approach you like more.
Here is a example how you can fire the event by yourself (partly from the comment by @JohanHaest)
To make it simple I say you have only single selection enabled
var record = combo.store.getById(id);
combo.select(id);
combo.fireEvent('select', combo, record);
or
combo.select(model);
combo.fireEvent('select', combo, model);
There is a possible Hack in the current release (4.1.3) when setting a second argument on the select
method to true
. This will, according to the sourcecode, fire the select event. But the First argument has to be a Model instance.
// source-snipped
select: function(r, /* private */ assert)
So calling
combo.select(model, true);
will fire the select event but this behavior may change at any time (version) cause the assert is marked as private