jQWidgets Forums

jQuery UI Widgets Forums Lists ComboBox How to use .dataBind() in this case?

Tagged: 

This topic contains 2 replies, has 2 voices, and was last updated by  Peter Stoev 11 years, 9 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • How to use .dataBind() in this case? #29415

    dc4m
    Member

    Hi everyone,

    Please help me for this issue!
    This is my code:
    $(‘#cbbProjects’).jqxComboBox({
    theme: theme,
    width: 250,
    height: 22,
    source: new $.jqx.dataAdapter({
    datatype: ‘json’,
    datafields: [
    { name: ‘ProjectId’ },
    { name: ‘ProjectName’ },
    { name: ‘CustomerId’ },
    { name: ‘CustomerName’ }
    ],
    id: ‘ProjectId’,
    url: appPath + ‘Common/GetProjectForAutocomplete’
    }, {
    formatData: function (data) {
    return { keyword: $(‘#cbbProjects’).jqxComboBox(‘searchString’), limit: 10, mode: “select” }
    }
    }),
    minLength: 0,
    remoteAutoComplete: true,
    remoteAutoCompleteDelay: 600,
    displayMember: ‘ProjectName’,
    valueMember: ‘ProjectId’,
    search: function (searchString) {
    //???????
    }
    });

    I want to reload data in this combobox when I fire an event in another combobox?
    Note: I do not want to declare ‘soure’ or ‘dataAdapter’
    Thanks!

    How to use .dataBind() in this case? #29417

    dc4m
    Member

    I got it! When I use:
    $(‘#cbbProjects’).jqxComboBox(‘source’).dataBind();
    and it work!

    But I still have another problem. How to add parameters to formatData?
    Please help me…!

    How to use .dataBind() in this case? #29422

    Peter Stoev
    Keymaster

    Hi dc4m,

    As you have the dataAdapter’s instance, you should just call dataAdapter.dataBind().

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

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

You must be logged in to reply to this topic.