Wanted to ask for advice on the following
Have data grid, with ItemFileWrite store
when a new item is 'Added' to the ItemFileStore
I would like to be able to execute an Ajax call to insert that item into
the
database and only when that call returns, I would like to 'commit' it to
the item file store,
otherwise, if the db update was not successful -- I would like to
rollback.
I have the following potential solutions, but would like to know if they
are 'recommended'
a) inherit from item file store, add 2 new methods
startSavingItem
finishSavingItem
first call startSaving, have starSaving execute dojo.RPC call to the
server, and specify
'finishSaving' as deffered method to be called on return of the ajax
call
Finish saving then gets called, and it executes 'newItem' on the
store.
b) First save in the database, then add to the item file store
however, for some reason I am thinking that the stores provide better
'built-in' management
with callbacks, but I cannot figure out exactly what examples to look
for on this
(I use in other places in program dojox.data.ServiceStore but this is
for 'read only' stores)
thank you in advance,
Vlad
--
Vlad P
author of C++ ORM
http://github.com/vladp/CppOrm/tree/master--
http://www.fastmail.fm - Accessible with your email software
or over the web
_______________________________________________
FAQ:
http://dojotoolkit.org/support/faqBook:
http://dojotoolkit.org/docs/bookForums:
http://dojotoolkit.org/forumDojo-interest@...
http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest