jQWidgets Forums

jQuery UI Widgets Forums General Discussions Lists DropDownList triggering a change event on widget's select IN BACKBONE

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

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

  • DaveC426913
    Member

    I’m progressively enhancing my form by converting selects to dropdpwnLists.

    we are using backbone

    Two of my fields are ‘country’ and ‘state’. State can’t populated until I know what country has been selected. This is easy enough to do for the original selects:

            events: {
    "change select[name='country']" : "setStateFromCountry",
    },

    But after I’ve enhanced these selects, there’s no ‘change’ event on a div.

    Ultimately this is essentially what I want to do:

    “change #widgetDropdown-country” : “setStateFromCountry”

    but HOW???


    Peter Stoev
    Keymaster

    hi DaveC426913,

    jqxDropDownList already have a ‘change’ event.

    Here’s a code which demonstrates how to use it:

    $('#jqxDropDownList').bind('change', 
    function (event) {
    var args = event.args;
    if (args) {
    // index represents the item's index.
    var index = args.index;
    var item = args.item;
    // get item's label and value.
    var label = item.label;
    var value = item.value;
    } });

    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.