jQWidgets Forums

jQuery UI Widgets Forums Lists DropDownList Problem refreshing multiple data-bound dropdowns

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

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

  • mboyle
    Member

    Hello,

    I have a problem where if I have multiple jqxDropDownLists defined on a page (all initialized using Knockout) and if they start off with the same index selected, then when I update the Knockout ViewModel only one of the dropdowns is updated. Here is my code (minus jqwidgets + knockout library references):

    <script type="text/javascript">
    var list = [
    { ID: "Item1", Description: "Item 1" },
    { ID: "Item2", Description: "Item 2" },
    { ID: "Item3", Description: "Item 3" }
    ];
    var ViewModel = function () {
    var self = this;
    self.dropdown1 = ko.observable(0);
    self.dropdown2 = ko.observable(0);
    self.dropdown3 = ko.observable(0);
    self.resetAll = function () {
    self.dropdown1(0);
    self.dropdown2(0);
    self.dropdown3(0);
    }
    }
    var myVM = new ViewModel();
    $(function () { ko.applyBindings(myVM); })
    </script>
    <div data-bind="jqxDropDownList: {
    source: list,
    selectedIndex: dropdown1,
    valueMember: 'ID',
    displayMember: 'Description',
    height: 30,
    width: 100
    }"></div>
    <div data-bind="jqxDropDownList: {
    source: list,
    selectedIndex: dropdown2,
    valueMember: 'ID',
    displayMember: 'Description',
    height: 30,
    width: 100
    }"></div>
    <div data-bind="jqxDropDownList: {
    source: list,
    selectedIndex: dropdown3,
    valueMember: 'ID',
    displayMember: 'Description',
    height: 30,
    width: 100
    }"></div>
    <input type="button" data-bind="click: resetAll" value="Reset" />

    Thank you.


    Peter Stoev
    Keymaster

    Hi mboyle,

    We confirm the reported behavior and added a work item about it. We will resolve it for a future version of jQWidgets.

    Best Regards,
    Peter Stoev

    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.