jQWidgets Forums

jQuery UI Widgets Forums Lists ComboBox Event – Reload Data from Remote Source

This topic contains 8 replies, has 4 voices, and was last updated by  DavidSimmons 12 years, 6 months ago.

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

  • carmelchas
    Member

    I desire to allow a client to select an option from a potentially large data-set.  I do not wish to load the entire data-set, rather have the client start typing and then query for a result-set matching the search criteria.

    Is it possible with the current implementation for jqxDataAdapter and/or jqxCombobox to do any of the following:

    1. Set URL parameters for jqxComboBox datasource prior to the request being sent to the remote source? [on page load]
    2. Is there a data “refresh” method for jqxComboBox or jqxDataAdapter?
    3. I so (“B”), “A”?  [e.g. When the user types a different value in the TextArea]

    Please help.  I cannot find examples beyond basic usage anywhere.

    Note: I am new to this forum and to jqWidgets.  If I am assuming too much regarding the current capabilities of these libraries, please let me know.

    Sincerely,

    Charles A Beasley
    carmelchas@gmail.com

    Event – Reload Data from Remote Source #3557

    Peter Stoev
    Keymaster

    Hi Charles,

    The ComboBox’s built-in Search currently works only with already loaded data i.e when the user enters data into the ComboBox’s input field, it tries to find a match within its the current list of items.

    To set parameters before the ajax request, you can use the processdata callback.

    For example:

    // prepare the data
    var source =
    {
    datatype: "json",
    datafields: [
    { name: 'CompanyName' },
    { name: 'ContactName' }
    ],
    id: 'id',
    url: url,
    async: false,
    processdata: function (data) {
    data.myProperty = "My Value";
    }
    };
    var dataAdapter = new $.jqx.dataAdapter(source);

    To rebind the jqxDataAdapter, call its dataBind method.
    To refresh the ComboBox’s data source, sets its source property.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Event – Reload Data from Remote Source #7517

    Marc
    Participant

    This functionality (selecting from a large data set using a combo box) is important to us as well. I noticed that your ListBox demo page now features a “Remote Search” option, which appears to be dynamically filtering in this way (the explanation is not clear about what exactly is happening). The code appears to bind to the keydown event and refresh the data source by rebinding. Is that correct, and if so, is it possible to do something similar with a combo box?

    Thanks,

    Marc

    Event – Reload Data from Remote Source #7518

    Peter Stoev
    Keymaster

    Hi Marc,

    There’s such demo for the ComboBox, too. See remotesearch.htm.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Event – Reload Data from Remote Source #7533

    Marc
    Participant

    Excellent! Thanks for the quick response.

    Is this a new feature (version 2.4+)? Is it the remoteAutoComplete attribute that enables the functionality (I don’t see that attribute documented on the API page for the ComboBox)? Does that cause the search callback to execute after each character? It looks like it initially loads the first n entries and then updates from the server once two characters have been entered, is that correct?

    Marc

    Event – Reload Data from Remote Source #7534

    Peter Stoev
    Keymaster

    Hi Marc,

    Yes, the remoteAutoComplete enables it. Updates are handled in the search callback function when the user types into the ComboBox’s input field.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Event – Reload Data from Remote Source #7548

    Peter Stoev
    Keymaster

    Hi Marc,

    I wanted to let you know that the API documentation about the ComboBox has just been updated and the remoteAutoComplete and search properties are included.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Event – Reload Data from Remote Source #7631

    Marc
    Participant

    Excellent! Thanks for the quick update.

    Marc

    Event – Reload Data from Remote Source #11557

    DavidSimmons
    Participant

    Looking at there example can anyone help me understand what is being passed to the server? I am trying build a php version.

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

You must be logged in to reply to this topic.