saveBatch

makes simultaneous saving of several components

void saveBatch(function handler);
handlerfunctionuser-defined handler function

Example

$$('myform1').bind('myStore');
$$('myform2').bind('myStore');
 
 
$$("datatable1").saveBatch(function(){
   $$("form1").save();
   $$("form2").save( $$("form2").getDirtyValues() );
});

Details

The code snippet above shows the most popular use case - saving changes made in 2 bound forms.

Both forms store the entire data object. As a result, the second form will overwrite all changes that were made in the first one.

To save data simultaneously, we use the saveBatch() method. To prevent data overwriting, it's also necessary to use the getDirtyValues method. It returns only the fields that were changed in the form.

Back to top
Join Our Forum
We've retired comments here. Visit our forum for faster technical support, connect with other developers, and share your feedback there.