« Return to Thread: [Q] input arguments to JsonRestStore vs PersevereStore

Re: [Q] RESOLVED input arguments to JsonRestStore vs PersevereStore

by Kris Zyp-4 :: Rate this Message:

Reply to Author | View in Thread

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
 


V S P wrote:

> Got the
> client side querying of the Perserve data store to work
>
> Maulins reply had me going in right direction about using clientFetch
>
> but this web page
> http://docs.dojocampus.org/dojox/data/ClientFilter
>
> listed one more thing to get this to work (that I was missing)
>
> -----
> To use the ClientFilter with a data store which offers optional support
> of ClientFilter (like dojox.data.ServiceStore and
> dojox.data.JsonRestStore), it's important to observe the correct
> sequence:
> include dojox.data.ClientFilter
> include the data store
>
> set queryOptions:{cache:true} in the request
>
> or use a Widget with a option to cache each request (for example the
> Grid with the queryOptions attribute:
>
> <table queryOptions="{cache:true}" dojoType="dojox.grid.DataGrid" ...)
> -----------------
>
>
> I was missing the 'or' part -- that is enabling in the Grid
> queryOptions="{cache:true}"
>
>
> I had option set on the store, then on the query, but not on the grid.
>
> And I guess that was causing not being able to find any items except the
> last added one,
> and it was causing queries to go to the server.
>
>
> The only remaining part for me to resolve now is why
>
>> crmService.post = function(id, value) {
>> console.log('calling add with id:',id, ' and value: ',value);
>> return dojo.xhrPost({url:"addService", handleAs:'json',
>>     content:{action:'add',"id":id, "value":value}});
>> };
>
>
> does not get the id argument populated when invoked (I assume it is the
> identity for the row being inserted)
>
The expectation is that the server will assign the id itself, and
return the new id in the "Location" header in the response. If you
actually do really like the ids assigned by the client, the server
doesn't need to return a Location header, and the server can determine
the client assigned id from the Content-ID header on the request.

- --
Kris Zyp
SitePen
(503) 806-1841
http://sitepen.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
 
iEYEARECAAYFAkpNtIsACgkQ9VpNnHc4zAx8OwCff+YyGxslIPn/p5nPz1XQUfwe
p1gAn1fmmfd0mIzaGZjc5w4c6RTeDzaL
=EsVx
-----END PGP SIGNATURE-----

_______________________________________________
FAQ: http://dojotoolkit.org/support/faq
Book: http://dojotoolkit.org/docs/book
Forums: http://dojotoolkit.org/forum
Dojo-interest@...
http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest

 « Return to Thread: [Q] input arguments to JsonRestStore vs PersevereStore