[CLOSED] How to properly produce and handle a success=false result during Store save

  1. #1

    [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.

       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]
  2. #2
    Hello!

    Please, look at this thread http://forums.ext.net/showthread.php...ailed-Listener
  3. #3
    Quote Originally Posted by Baidaly View Post
    Ahh,I see I was missing the after direct event handler and the required global success and message fields.

    Thanks

    [Closed]

Similar Threads

  1. Replies: 3
    Last Post: Jan 03, 2013, 6:57 PM
  2. [CLOSED] How to handle the result of DirectMethod?
    By vadym.f in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Sep 17, 2012, 4:15 PM
  3. [CLOSED] How to properly handle exceptions in Direct Events?
    By vadym.f in forum 1.x Legacy Premium Help
    Replies: 7
    Last Post: Feb 07, 2012, 5:00 PM
  4. [CLOSED] How to handle store save postback?
    By capecod in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Oct 15, 2010, 8:45 AM
  5. Replies: 1
    Last Post: Jun 07, 2010, 7:19 AM

Tags for this Thread

Posting Permissions