Jan 09, 2013, 4:45 PM
[CLOSED] How to properly produce and handle a success=false result during Store save
Hi All,
I'm trying to understand how to manage saving data from a store and handling failure.
My scenario is this:
1 grid on the left with a form on the right. Fill out the form, add that record to the grid (by using JS) and then calling save on the store. I have a BeforeRecordInserted method and using confirmation id.
so I might do something like:
I'm trying to understand how to manage saving data from a store and handling failure.
My scenario is this:
1 grid on the left with a form on the right. Fill out the form, add that record to the grid (by using JS) and then calling save on the store. I have a BeforeRecordInserted method and using confirmation id.
protected void UsersStore_BeforeRecordInserted(object sender, BeforeRecordInsertedEventArgs e)
{
}
and I would like to simulate failure for the moment and then return FALSE for success and then how do I remove that newly added row? (store.rejectChanges() reloads the store??? ) so I might do something like:
protected void UsersStore_BeforeRecordInserted(object sender, BeforeRecordInsertedEventArgs e)
{
e.Cancel=true;
e.Confirmation.UnConfirmRecord();
}
So how do I handle this properly.
Last edited by Daniil; Jan 10, 2013 at 5:00 PM.
Reason: [CLOSED]