jQWidgets Forums

jQuery UI Widgets Forums Lists ComboBox ComboBox delayed loading question

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

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • ComboBox delayed loading question #15619

    alexz
    Member

    Hi,

    I have common combo declaration and everything works fine. When page loads, combo immediately send request to remote url to populate itself. Can I change this behavior that request is send only when user opens the combo?

    <script type="text/javascript">
    $(document).ready(function() {
    // TODO: get from user settings
    var theme = 'classic';
    // prepare the data
    var source =
    {
    datatype: 'json',
    datafields: [
    { name: 'Id' },
    { name: 'DisplayValue' }
    ],
    url: '/Customers',
    data: {
    // TODO: parameter name that really works, maxRows is just default
    maxRows: 12
    }
    };
    var dataAdapter = new $.jqx.dataAdapter(source,
    {
    formatData: function(data) {
    data._q = $('#e592ee69-12fa-4eb6-9812-6e3120c96e43').jqxComboBox('searchString');
    return data;
    }
    }
    );
    $('#e592ee69-12fa-4eb6-9812-6e3120c96e43').jqxComboBox(
    {
    width: 250,
    height: 25,
    source: dataAdapter,
    remoteAutoComplete: true,
    theme: theme,
    selectedIndex: 1,
    displayMember: 'DisplayValue',
    valueMember: 'Id',
    renderer: function(index, label, value) {
    var item = dataAdapter.records[index];
    if (item != null) {
    var label = item.DisplayValue;
    return label;
    }
    return "";
    },
    renderSelectedItem: function(index, item) {
    var item = dataAdapter.records[index];
    if (item != null) {
    var label = item.DisplayValue;
    return label;
    }
    return "";
    },
    search: function(searchString) {
    dataAdapter.dataBind();
    }
    });
    $('#e592ee69-12fa-4eb6-9812-6e3120c96e43').bind('change', function (event)
    {
    var args = event.args;
    if (args) {
    var item = args.item;
    $('#InvoicingCustomerId').val(item.value);
    }
    });
    });
    </script>
    ComboBox delayed loading question #15664

    Dimitar
    Participant

    Hello alexz,

    Such feature is not available to jqxComboBox at the moment. However, we have created a work item on the matter and will consider implementing it in future versions of jQWidgets.

    Best Regards,
    Dimitar

    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.