.rollback()

Previous Next

Rolls back manipulated data.

Returns the 'this' object.

Syntax

.rollback( options )

 

options :=  {

    keepSelectionskeep-selections

,   quiet: quiet

,   success: success-function

,   error: error-function

}

 

keep-selections  :=  { true | false }

quiet            :=  { true | false }

Options is a struct that can have the following items, all of which are optional.

Keep-selections is a boolean that specifies whether the current record remains the same after rollback:

Value

Description

true (the default)

The current record is guaranteed to be the same record as before the rollback, in the sense of "the same data": the record with the same primary key values.

false

The current record after rollback is guaranteed to be the record that has the same position in the row set as the current record had before the rollback.

Quiet is a boolean that determines whether or not a message is displayed when the rollback is completed. The default is false, meaning that a message is displayed by default.

Success-function is a function called when the rollback is completed.

Error-function is a function called if the rollback fails.

 

Example

$.udb.rollback({
 success: function(event,state){
         if(state.msg=='')alert('Succeeded!');
 }
);