jQWidgets Forums
jQuery UI Widgets › Forums › Lists › ComboBox › Event – Reload Data from Remote Source
Tagged: jqxComboBox jqxDataAdapter
This topic contains 8 replies, has 4 voices, and was last updated by DavidSimmons 12 years, 6 months ago.
-
Author
-
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:
- Set URL parameters for jqxComboBox datasource prior to the request being sent to the remote source? [on page load]
- Is there a data “refresh” method for jqxComboBox or jqxDataAdapter?
- 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.comHi 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 datavar 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 StoevjQWidgets Team
http://www.jqwidgets.comThis 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
Hi Marc,
There’s such demo for the ComboBox, too. See remotesearch.htm.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comExcellent! 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
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 StoevjQWidgets Team
http://www.jqwidgets.comHi 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 StoevjQWidgets Team
http://www.jqwidgets.comExcellent! Thanks for the quick update.
Marc
Looking at there example can anyone help me understand what is being passed to the server? I am trying build a php version.
-
AuthorPosts
You must be logged in to reply to this topic.