The combobox example source is all right there in the example. I'd trigger the change
event of the underlying select by modifying the source code like this (changing the select
event handler inside autocomplete initialization inside the plugin):
/* Snip */
select: function( event, ui ) {
ui.item.option.selected = true;
self._trigger( "selected", event, {
item: ui.item.option
});
select.trigger("change");
},
/* Snip */
and then define an event handler for the regular change
event of the select
:
$(".cmbBox").change(function() {
alert(this.value);
});
Unfortunately this won't work exactly the same way as the normal select.change
event: it will trigger even you select the same item from the combobox.
Try it out here: http://jsfiddle.net/andrewwhitaker/hAM9H/
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…