jQWidgets Forums

jQuery UI Widgets Forums Lists DropDownList selectedIndex in jqxDropDownList become weird after upgrade to 3.9.0

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

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

  • harunmahfud
    Participant

    SelectedIndex function is not functioning unless I set my datasource async value to false.
    this is my code

    $('#purpose').jqxDropDownList({
    	theme: theme,
    	autoDropDownHeight: true,
    	source: new $.jqx.dataAdapter({datatype: 'json', datafields: [{name: 'matr_purpose'}, {name: 'description'}], url: 'master/purpose', async: false}), //if async: false is removed, selectedIndex is not working
    	displayMember: 'description',
    	valueMember: 'matr_purpose',
    	enableBrowserBoundsDetection: true,
    	width: 150,
    	selectedIndex: 3
    });

    It’s weird because in previous version I don’t have to set async value to false.
    I need to upgrade to latest version to use your new awesome widgets, but unfortunately I must change a lot of my drowpdownlist source.
    Can you revert SelectedIndex function like in previous version?


    ivailo
    Participant

    Hi harunmahfud,

    To be sure that on async mode the binding is completed, before initialization of the widget please use:

    $("#purpose").on('bindingComplete', function (event) {
                          $("#purpose").jqxDropDownList('selectIndex', 3 );
    });

    This workaround must be helpful in nthis situation.

    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.