Opened 12 years ago

Closed 12 years ago

Last modified 10 years ago

#4597 closed enhancement (fixed)

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

Reported by: wolfram Owned by: Jared Jurkiewicz
Priority: high Milestone:
Component: DojoX Data Version: 0.9
Keywords: Combobox Cc: jorvis
Blocked By: Blocking:

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 (2)

QueryReadStore.files.patch (34.6 KB) - added by wolfram 12 years ago.
made the comboboxes really work
20071016_dojox.data.QueryReadStore.patch (36.8 KB) - added by Jared Jurkiewicz 12 years ago.
Fixes to the patch

Download all attachments as: .zip

Change History (21)

comment:1 Changed 12 years ago by wolfram

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

comment:2 Changed 12 years ago by Jared Jurkiewicz

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?)

comment:3 Changed 12 years ago by Jared Jurkiewicz

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.

comment:4 Changed 12 years ago by Jared Jurkiewicz

Type: defectenhancement

Changing to enhancement since this is a new store.

comment:5 Changed 12 years ago by jorvis

Cc: jorvis added

comment:6 Changed 12 years ago by guest

Very good work, Wolfram! Much appreciated.

comment:7 Changed 12 years ago by bill

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

comment:8 Changed 12 years ago by Jared Jurkiewicz

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.

comment:9 Changed 12 years ago by Jared Jurkiewicz

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.

comment:10 Changed 12 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

comment:11 Changed 12 years ago by Jared Jurkiewicz

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

comment:12 in reply to:  11 Changed 12 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 :-)

comment:13 Changed 12 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.

comment:14 Changed 12 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 12 years ago by wolfram

Attachment: QueryReadStore.files.patch added

made the comboboxes really work

comment:15 Changed 12 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

comment:17 in reply to:  16 Changed 12 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 12 years ago by Jared Jurkiewicz

Fixes to the patch

comment:18 Changed 12 years ago by Jared Jurkiewicz

Resolution: fixed
Status: newclosed

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

comment:19 Changed 12 years ago by Jared Jurkiewicz

Resolution: fixed

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

Note: See TracTickets for help on using tickets.