jQWidgets Forums

jQuery UI Widgets Forums Lists DropDownList Json + Drop down list

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
  • Json + Drop down list #19610

    naatha
    Member

    Hello,

    I am populating my drop down list using the following code:

    var source =
    {
    datatype: "json",
    type: 'GET',
    url: 'Service.aspx/GetList',
    cache: false,
    datafields:
    [
    { name: 'ID'},
    { name: 'City'}
    ],
    }
    var dataAdapter = new $.jqx.dataAdapter(source, {
    contentType: "application/json; charset=utf-8",
    loadError: function (xhr, status, error) {
    alert(error);
    },
    downloadComplete: function (data, textStatus, jqXHR) {
    return data.d;
    }
    });
    $("#dropdownlist").jqxDropDownList({ source: dataAdapter, displayMember: "City", valueMember: "ID", width: '300', height: '25', theme: theme });

    when the list items change in the server side, i want to fill the drop down list dynamically by using a refresh button.

    How can i achieve this ?

    for grid, i am using updatebounddata. Could not find anything for drop down list.

    Thanks

    Json + Drop down list #19756

    Peter Stoev
    Keymaster

    Hi naatha,

    To refill the DropDownList, you may call the dataAdapter’s dataBind() method. It will make another server call and automatically update the widget with the new data.

    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.