Login Register

A question about stores and lazy loading.

A question about stores and lazy loading.

Which solution do we have to reduce the quantity of data between the serveur and the client ?

dojo.data.ItemFileReadStore just use a url to retrieve data.

If your dataset contains 20 000 records and you want to get the first 100, the only solution I know is putting offset and rowcount arguments in the url.

If you want the next 100 this is another url thus another datastore.

Is there a way to get the dataset in small pieces into the same datastore ?

Best regards

Roger

Solution?

Is this the right solution for you?

Regards,
 Remi

Incrementally or sequentially loading not supported?

Perhaps I'm misguided, but it seems that's maybe possible to submit start and count parameters to the fetch-method, but the whole fetch-method of a ItemFileReadStore uses only the simpleFetch mixin:

// The simpleFetch mixin should work well for any datastore that can respond to a _fetchItems()
// call by returning an array of all the found items that matched the query. The simpleFetch mixin
// is not designed to work for datastores that respond to a fetch() call by incrementally
// loading items, or sequentially loading partial batches of the result
// set.

Remi

The purpose is Client-side or Server-side pagination

Actually the ItemFileReadStore gives the possibility to achieve client side pagination with the start and coutn attributes. Fine BUT if the data store must first download 20 000 records from the server you have to wait a very long long time to display the first page.

For me the only valuable solution is to achieve server side pagination. The client just ask the server for more data when he is missing it.

That's why I asked for merging datastores since each time you call the server it is with another url thus a different datastore

see also

Hi Roger,

I know, what you mean (see also my comment from yesterday).
Perhaps the developers are able to help here.

Regards,
 Remi

server side paging not possible with Dojo

Sad, but there is no solution available with DojoToolkit.
Or the developers have no time to answer questions here.

:-((
Remi

dojo.data was designed with this in mind.

...but since we do our best to be server-agnostic, I'm not sure there's an actual implementation somewhere yet. If there is, it'd be in DojoX and not in the Dojo Core. This is the primary reason why queries are asynchronous in nature.

IIRC, the basic idea is that you can write your own custom Store that implements the incremental server pull. I don't know enough about it, maybe one of the Dojo Data guys can chime in.

IMHO to be server-agnostic

IMHO to be server-agnostic doesn't mean that you cannot define any interface to achieve server-side pagination.
Any server will accept requests with parameters like start and count or next.

The problem here is that each request to the server results in a different datastore. So if you want to be able to take advantage of dojo datastores like filtering or sorting use have to merge the datastores from each request to the one on witch your interface is build.

I would like to see the following extension to : ItemFileReadStore :

  • a "merge" method for the datastores near the "fetch" method.
  • a "total records" property that will indicate how many records there are in total on the server for this datastore.
  • filtering and soring requests would goback to the server it the whole dataset haven't been downloaded

Best regards
Roger

Nobody knows it

The problem is, nobody knows enough about it, so nobody knows how to do that.
I've tried to start a discussion with the Dojo Data developers, but they don't say a word to this problem (not here in the forum, not in the Mailing list, not in the Dojo Book, and not at the Dojo data meetings).
Perhaps I choosed the wrong way in order to request a answer?

Remi

The solution exists

I implemented a dojo data store that implemented server side filtering, sorting and pagination. The dojo showcase has the link to the demo. The dojo forum link for this is...

http://dojotoolkit.org/customised-filtering-table-running-remotedatastor...

The demo link is

http://weblogic.cyberavenue.com.au/SuperGridWebApp/msss_master_rules.htm...

The demo was implemented on dojo 0.4.3 and a project is currently underway to provide a dojo0.9 implementation and a new server side implementation.

The dojo guys probably aren't talking much about it because they are focused on client side javascript. Implementation of a datastore like this requires significant server side work which is outside the realm of dojo.