문제

I'm trying to get events like select / change or something useful from jquery-ui Autocomplete Combobox.

I have create the simple scenario on http://jsfiddle.net/QSMv5/ This is the example you can find on jquery-ui site http://jqueryui.com/autocomplete/#combobox.

Simply trying something like the following do nothing:

 $( "#combobox" ).click(function() {
      alert('hi');
    });

But for example this works it I trigger the event from code.

So I think this could be probably due to event propagation or something similar..

Does anyone could point me to right direction and get event fired when user select from DropDown?

도움이 되었습니까?

해결책

For this specific scenery, you can use something like this: (see http://jsfiddle.net/QSMv5/2/)

$( ".custom-combobox-input" ).on( "autocompleteselect", function() { 
    alert('hi') 
} );    

But, note that .custom-combobox-input is a class used in the input element of this example. On your real code, this may be different.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top