jQWidgets Forums

jQuery UI Widgets Forums Lists ComboBox Open triggers select

This topic contains 5 replies, has 3 voices, and was last updated by  ivailo 8 years, 5 months ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
  • Open triggers select #85474

    kend
    Participant

    I have a multiselect jqxComboBox. Its initialized like this:
    $(divID).jqxComboBox({multiSelect: true,
    width: “100%”,
    source: adapter,
    dropDownHeight: ‘200px’,
    displayMember: “DisplayName”,
    autoComplete: false,
    selectedIndex: -1,
    });

    whenever the comboBox is opened for the first time, it selects the first item in the comboBox. I dont want it to do this and I can’t figure out how to stop it. When the open is done, it also triggers the select method. I’ve tried opening it myself with a mouse click and I’ve tried calling the open method programatically to make it happen also. Either way, it selects the first item in the list.

    I can verify that this happens by adding some code to the select method like this:
    $(divID).on(‘select’, function(event) {
    var items = $(divID).jqxComboBox(‘getSelectedItems’);
    });

    This “on select” method is called as soon as open is done and the first item in the list is returned in “items”.

    I tried reproducing this with sample code and this doesnt happen. Is there something I’m doing wrong? I cant figure it out.

    This code triggers it programatically:
    var items = $(div).jqxComboBox(‘getSelectedItems’);
    $(div).jqxComboBox(‘open’);

    when I look at items before the call to “open”, there are none selected. As soon as the call to open happens, “on select” gets triggered and the first item in the list is returned in “items”.

    I also noticed that “on open” is also triggered, but it is triggered after “on select”.

    Open triggers select #85482

    ivailo
    Participant

    Hi kend,

    Here is a demo with your code and there are no selected items on initialization.
    Please, try to update to the latest version(4.1.2).

    Best Regards,
    Ivailo Ivanov

    jQWidgets Team
    http://www.jqwidgets.com

    Open triggers select #85489

    kend
    Participant

    I have tried upgrading to 4.1.2 and it didnt fix it. I also agree that the demo doesnt show the problem, but it does happen in my code. I also have 4 comboboxes on my screen and 2 of the 4 do this. Its weird that they dont all do it. I tried converting to the alternate style using checkboxes. It doesnt happen when I use them. So I guess I’ll switch to that style.

    Open triggers select #85490

    ivailo
    Participant

    Hi kend,

    Please, send a jsfiddle/jseditor demo with your code for better analyze of the problem.

    Best Regards,
    Ivailo Ivanov

    jQWidgets Team
    http://www.jqwidgets.com

    Open triggers select #89809

    mircea.ontanu
    Participant

    Hi,

    I’m having the same issue as kend.
    I’m on jQuery 1.11.1 and jQWidgets 4.4.0

    It is a combobox, and it’s automatically selecting the first item if I click on the dropdown arrow, or it is automatically selecting the first thing that I try to type.

    $(“#_comboPrjPeople”).jqxComboBox({
    theme: _generalTheme,
    source: _usersDataAdapter,
    showArrow: true,
    multiSelect: true,
    displayMember: “email”,
    valueMember: “userID”,
    height: 25, width: ‘100%’
    });

    I have other comboboxes into the project but none of those have this issue.

    I know you need a jsfiddle sample but I can’t figure out how to create one with all the stuff on the same page also the data comes from an ASP .NET application. There is some other way to debug this thing or at least places where I need to look. What things can affect that event.

    Thanks,
    Mircea

    Open triggers select #89852

    ivailo
    Participant

    Hi mircea.ontanu,

    Please, refer to the following example: http://jsfiddle.net/q8bsh9cL/
    Here are used your settings and we can’t see the problematic behavior.

    Best Regards,
    Ivailo Ivanov

    jQWidgets Team
    http://www.jqwidgets.com

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

You must be logged in to reply to this topic.