[Dojo-interest] dojo.store.Observable Change Request
Ben Hockey
neonstalwart at gmail.com
Fri Aug 26 09:19:50 EDT 2011
setData is not part of the store API - it's specific to the memory store. This would be why it shouldn't be added to observable. Maybe you could write your own MemoryObservable or something. I seem to remember that in a similar situation I just added each item via put rather than setData.
Fwiw I don't think I've yet had a single store that has been unmodified. This happens to be the "right" way to use the stores. Developers should expect that they may be more likely to have to extend a store or implement their own than not. I expect you already know this so I just mention it for anyone else who might come across this.
ben...
Sent from my Palm Pre on AT&T
On Aug 26, 2011 7:01, Rob Weiss <j105.rob at gmail.com> wrote:
In our application we have co-dependent stores we are using to support drilling down through data using observable queries. In trying to figure out how to reset the stores to the original set of data and trigger the observers that the store has been reset, I noticed that an answer might be to add a function to the whenFinished function list in the Observable class for the setData function of the Memory store.
This seems to work since technically the setData should act like a put:
whenFinished("setData", function(data){ dojo.forEach(data,function(item){
store.notify(item, store.getIdentity(item)); }); });
Is this something that should be added to the Observable class? Does it make the store too chatty? I need this functionality, but I thought I would pass on my thoughts. Seems like any action that would change data in the store should have a notification hook for observers.
Thanks,Rob.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.dojotoolkit.org/pipermail/dojo-interest/attachments/20110826/f6316245/attachment-0001.htm
More information about the Dojo-interest
mailing list