jQWidgets Forums

jQuery UI Widgets Forums General Discussions Lists DropDownList Setting selectedIndex:-1 doesn't prevent the OnSelect event from being activated

This topic contains 1 reply, has 2 voices, and was last updated by  Peter Stoev 12 years ago.

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

  • mtbvfr
    Member

    Hi,

    The OnSelect event, for the Clients DropDownList, sets the Data Source for the Sites DropDownList.

    The first time a Client is selected, the OnSelect event is NOT activated for the Sites DropDownList. This is OK. 🙂

    After selecting the first Site (which sets selectedIndex to 0) and then selecting a different Client, the OnSelect event IS activated for the Sites DropDownList even though the “selectedIndex” Property has been set to “-1” when refreshing the Data Source. This is NOT OK.

    Is this behaviour correct?

    I am now doing the following to circumvent this problem.

    $(‘#divDdlSites’).off(‘select’,fnDivDdlSitesSelect);
    $(“#divDdlSites”).jqxDropDownList({disabled:false,selectedIndex:-1,source:objJqxDataAdapter});
    $(‘#divDdlSites’).on(‘select’,fnDivDdlSitesSelect);

    Is this the best and/or most efficient way to prevent the OnSelect event from being activated in this circumstance?

    Thank you, Michael.


    Peter Stoev
    Keymaster

    Hi,

    When there is a selection change, through the API or through the UI, the ‘select’ event(we do not have OnSelect event) will be raised. That behavior is correct and works as expected.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com/

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

The topic ‘Setting selectedIndex:-1 doesn't prevent the OnSelect event from being activated’ is closed to new replies.