[Dojo-interest] DataGrid with incremental, filtered retrieval from REST service
G. Sharon Yang
okghyang at gmail.com
Wed Jul 15 18:16:45 EDT 2009
Hi, Dylan,
thanks for your example link. I want to try the example in my
computer. Here's what I did:
copy the whole file qtest-dyl.html and also the file 'qtest', put
those two files under the same directory, change dojo directory to my
dojo directory, a tiny change in the target for JsonQueryRestStore:
<div dojoType="dojox.data.JsonQueryRestStore"
id="mystore"
jsId="mystore"
target="qtest"
handleAs="json"
idAttribute="myid"
></div>
But I got this two errors:
......
404 Not Found
101ms dojo.js (line 16)
Error: Unable to load qtest/[:25] status:404
[Break on this error] (function(){var _1=null;if((_1||(typeof
...setTimeout(dojo._loadInit,1000);}})();\r\n
I didn't change anything for the file 'qtest' and this file is under
the same directory as the html file. What could be wrong?
Thanks. -Sharon
On Fri, May 15, 2009 at 1:03 AM, Dylan Tynan<dtynan at gmail.com> wrote:
> Hi Michael,
>
> I've been reading back through your JsonRestStore. It looks like you're
> actually pretty far along, so I don't know that I can contribute much, but I
> do have a leftover example of a grid attached to a JsonQueryRestStore
> (jsonreststore + jsonquery capability). It was created to track down a
> defect, so the code itself is full of syntactically creative experiments
> :) However, it does work and is pretty simple.
>
> I think this post references it with extra detail:
> http://www.dojotoolkit.org/forum/dojox-dojox/dojox-grid-support/how-do-i-do-more-complex-queries-my-data-store
> or the example itself is here:
> http://tpsreports.realsage.biz/qtest-dyl.html
>
> As far as the grid goes, you can control data/rows a couple of ways:
> - You can use the "count:" parameter to control the # of rows
> fetched/requested at a time (or you can use jsonquery-style [0:40] or
> whatever on the end of your query).
> - You can use rowsPerPage to control the # of rows that the grid fetches in
> a given block (page). Note that the rows may already be cached, of course,
> and not need a server-request (or if you loaded clientFilter then all rows
> from the store will be loaded & cached client-side --- like my example)
> - The keepRows is the settings that control how many rendered rows the grid
> keeps it's in it's cache (rendering all rows would eat memory so it defaults
> to like 75 or something)
>
> Dylan
>
> On Tue, Mar 17, 2009 at 11:18 AM, Michael Schuerig <michael at schuerig.de>
> wrote:
>>
>> I'd like to display rows from a potentially very large dataset in a
>> DataGrid. Data is provided from a RESTful JSON-service, however in a
>> format that needs to be processed before use. Filtering and sorting is
>> (and should be) handled by the service.
>>
>> What I need, I think, are
>>
>> - Widgets to define filter criteria and sort direction on each grid
>> column.
>> - A hook where I can map these criteria to request parameters understood
>> by the service.
>> - A hook where I can translate the JSON data returned by the service to
>> a suitable format.
>> - A way to tell the DataGrid to keep around only a limited amount of
>> data/rows.
>>
>> I've slogged through the code of dojox.data.ServiceStore,
>> dojox.data.JsonRestStore, dojox.rpc.Service, dojox.rpc.Rest, and a few
>> other classes. I have to admit that right now, I'm lost in the tangle
>> and have a hard time figuring out the architecture hidden somewhere
>> deep within.
>>
>> Presumably, what I'm trying to do is a rather common thing, or so I'd
>> like to think. Can someone provide or point me to an example, please?
>>
>> Michael
>>
>> --
>> Michael Schuerig
>> mailto:michael at schuerig.de
>> http://www.schuerig.de/michael/
>> _______________________________________________
>> FAQ: http://dojotoolkit.org/support/faq
>> Book: http://dojotoolkit.org/docs/book
>> Forums: http://dojotoolkit.org/forum
>> Dojo-interest at mail.dojotoolkit.org
>> http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
>
>
> _______________________________________________
> FAQ: http://dojotoolkit.org/support/faq
> Book: http://dojotoolkit.org/docs/book
> Forums: http://dojotoolkit.org/forum
> Dojo-interest at mail.dojotoolkit.org
> http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
>
>
More information about the Dojo-interest
mailing list