Ticket #4597 (closed enhancement: fixed)

Opened 3 years ago

Last modified 11 months ago

[patch][CLI] A combobox that works with huge server data (like in dojo 0.4 the dataUrl)

Reported by: wolfram Owned by: jaredj
Priority: normal Milestone:
Component: DojoX Data Version: 0.9
Severity: normal Keywords: Combobox
Cc: jorvis

Description

Many people already requested making the combobox work like in dojo 0.4 with the dataUrl. This is a store (first draft) for a dojo.data class that makes it possible loading data into a combobox partially upon typing a letter.

Using this class you can do the following:

    <div dojoType="dojox.data.QueryReadStore" jsId="store" url="/live-search/${searchString}/"></div>
    <input dojoType="dijit.form.ComboBox" store="store" />

${searchString} gets replaced by the string entered into the combobox input field when typed, each letter triggers a server request.

Attachments

QueryReadStore.files.patch (34.6 kB) - added by wolfram 3 years ago.
made the comboboxes really work
20071016_dojox.data.QueryReadStore.patch (36.8 kB) - added by jaredj 3 years ago.
Fixes to the patch

Change History

  Changed 3 years ago by wolfram

  • summary changed from A combobox that works with huge server data (like in dojo 0.4 the dataUrl) to [patch][CLI] A combobox that works with huge server data (like in dojo 0.4 the dataUrl)

  Changed 3 years ago by jaredj

Do you also have Unit tests and the like with a simplebackend file for testing? I don't generally commit anything into dojox.data without supporting tests to verify the store conforms to all dojo.data APIs and passes across IE 6, IE7, Firefox 2.0, and Safari (WebKit?)

  Changed 3 years ago by jaredj

Looked at the patch. That store isn't a complete implementation of a datastore. It's missing most of the Read API. That can't really be committed.

If you're willing to aqdd themissing apis and provide UT for it, I'd consider committing it.

  Changed 3 years ago by jaredj

  • type changed from defect to enhancement

Changing to enhancement since this is a new store.

  Changed 3 years ago by jorvis

  • cc jorvis added

  Changed 3 years ago by guest

Very good work, Wolfram! Much appreciated.

  Changed 3 years ago by bill

See also #3342 (when this is checked in that bug can be closed).

  Changed 3 years ago by jaredj

Store still isn't complete, I'm afraid. It's missing the close() API of Read, as well as getValues. Can't be checked in. There should also be at least one DOH testcase that tests the store for all defined APIs in Read. Look in any of the existing DOH tests for the stores and you will see the test for that. This needs similar.

  Changed 3 years ago by jaredj

Sorry to nitpick like this, but Datastores need to conform to the defined API and implement all methods listed. I also just noticed getFeatures is missing as well.

  Changed 3 years ago by wolfram

This uploaded version contains an (almost complete) data store, unittests and an example of how to use this store with a combobox in order to load data sequentially upon request when the user types in the combobox. The version requires #4649 and #4651 to make the unittests work.

You only need the file QueryReadStore.files.patch.

Data store

The data store is still incomplete, but most of the dojo.data.api.Read is implemented. This class provides a store that is mainly intended to be used for loading data dynamically from the server, used i.e. for retreiving chunks of data from huge data stores on the server. Upon calling the fetch() method of this store the data are requested from the server if they are not yet loaded for paging (or cached).

Use with a ComboBox?

In the html example you can see how to use this store with a ComboBox? where every keystroke requests the data from the server, it sends the entered data along and gets a filtered result set. This basically works, but there are many very useful things missing, such as

  • URL configuration, currently you have to build the server this way that it understands the query as it is send by the client
  • caching, there is no caching implemented yet
  • paging, is innefficient, since every page triggers a request to the server, which is absolutely unnecessary

follow-up: ↓ 12   Changed 3 years ago by jaredj

It's still missing the geatFeatures(), close() API's. I can't commit this into dojox until the full Read API is implemented. Sorry. :-(

in reply to: ↑ 11   Changed 3 years ago by wolfram

Replying to jaredj:

It's still missing the geatFeatures(), close() API's. I can't commit this into dojox until the full Read API is implemented. Sorry. :-(

no problem, i also just meant to "save" a version here, i stated inside the class that it doesnt yet fully support the read api. I will let you know and bug you when its done :-)

  Changed 3 years ago by guest

Thanks for the code, it works great with ComboBox? but unfortunatly it doens't with the FilteringSelect? widget because the fetchItemByIdentity and getIdentity functions are missing.

  Changed 3 years ago by wolfram

Jared, please have a look. Now it has quite some tests, if I am right the entire read api is supported. let me know what you think.

wolfram

Changed 3 years ago by wolfram

made the comboboxes really work

  Changed 3 years ago by wolfram

+ I have added the serverQuery-parameter, reasoning is explained in the inline docs fpr _fetchItems().

The last upload didnt work with the comboboxes.

+ I also added another combobox example which does the paging on the server, for really huge data this will be needed

(it just still has a bug, which closes the dropdown of the combobox when you click "more choices" for the paging :( )

2 questions:

1) Is the name QueryReadStore? good? Better proposals are welcome. 2) Will it go into dojox.data? And for which version of dojo?

wolfram

in reply to: ↑ 16   Changed 3 years ago by wolfram

Replying to bill:

RemoteReadStore?? ProxyReadStore?? PassThroughStore?? ServerStore??

ServerStore? sounds good to me, though ItemFileReadStore? is also a server store ... mmmh

Changed 3 years ago by jaredj

Fixes to the patch

  Changed 3 years ago by jaredj

  • status changed from new to closed
  • resolution set to fixed

(In [10875]) Committing in Wolfram's initial QueryReadStore? patch (with a few fixes) fixes #4597

  Changed 3 years ago by jaredj

  • status changed from closed to closed
  • resolution set to fixed

(In [11233]) Updated QueryReadStore?. fixes #4597

Note: See TracTickets for help on using tickets.