jQWidgets Forums

jQuery UI Widgets Forums Lists ComboBox Change event when autoComplete:true

This topic contains 1 reply, has 2 voices, and was last updated by  ivailo 10 years ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • Change event when autoComplete:true #72212

    techie
    Participant

    Hi,

    i implemented the simple demo. My code:`
    var source = [“United States”,”United Kingdom”,”Afghanistan”,”Albania”,”Algeria”,”American Samoa”,…and more];
    $(“#jqxcombobox”).jqxComboBox({ source: source, selectedIndex: 2, height: ’30px’ ,width: ‘100%’, theme: ‘bootstrap’, scrollBarSize:15, dropDownHeight: 450, animationType: ‘fade’, autoComplete: true});
    // disable the sixth item.
    $(“#jqxcombobox”).jqxComboBox(‘disableAt’, 5);
    // bind to ‘select’ event.
    $(‘#jqxcombobox’).bind(‘select’, function (event) {
    var args = event.args;
    var item = $(‘#jqxcombobox’).jqxComboBox(‘getItem’, args.index);
    alert(‘Selected: ‘ + item.label);
    });
    `
    When autoComplete:false, so the alert print the selected item, when autoComplete:true the alert print ever “United States” when i selected the item with autocomplete (first item).


    ivailo
    Participant

    Hi techie,

    In your code you’re get the wrong item.

    Look at this javascript demo. Here the alert displays the actual label.

    Best Regards,
    Ivailo Ivanov

    jQWidgets Team
    http://www.jqwidgets.com

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.