jQWidgets Forums

jQuery UI Widgets Forums Lists ComboBox Filter problem

This topic contains 2 replies, has 2 voices, and was last updated by  bosjabosja 13 years, 1 month ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • Filter problem #2246

    bosjabosja
    Member

    Hello,

    I have a problem with search in combobox. When I try to search for some item, and stop typing in middle of word, and then click outside of combobox, in the head of combobox will be be just the half of the word, not some item. Is it possible that in this situation, we react with default selected index or something like that.

    Thanx

    Filter problem #2251

    Peter Stoev
    Keymaster

    Hi bosjabosja,

    You can do the following:

    – bind to the ComboBox’s select, open and close events.
    – create a variable called selectedIndex. Save the new selected index in this variable when the combobox is opened or when the user selects an item with mouse or keyboard.
    – set the ComboBox’s selectedIndex property when the ComboBox’s popup is closed.

    var selectedIndex = -1;
    $("#jqxComboBox").bind('select', function (event) {
    if (event.args && event.args.type != 'none') {
    selectedIndex = $("#jqxComboBox").jqxComboBox('selectedIndex');
    }
    });
    $("#jqxComboBox").bind('open', function (event) {
    selectedIndex = $("#jqxComboBox").jqxComboBox('selectedIndex');
    });
    $("#jqxComboBox").bind('close', function (event) {
    $("#jqxComboBox").jqxComboBox({ selectedIndex: selectedIndex });
    });

    Best Regards,
    Peter Stoev

    http://www.jqwidgets.com
    jQWidgets Team

    Filter problem #2252

    bosjabosja
    Member

    Thank you very much,

    that’s exactly what I needed

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

You must be logged in to reply to this topic.