Documentation

saveBatch

makes simultaneous saving several components

void saveBatch(function func);

Parameters

funcfunctionuser-defined handler function

Example

$$('myform1').bind('myStore');
$$('myform2').bind('myStore');
 
$$('myStore').saveBatch(function(){
        $$('myform1').save();
        $$('myform2').save();
});

Details

The code snippet above shows the most popular use case - saving changes made in 2 bound forms.\ Sequential saving provokes data loss: when we save data in one form, the second form is updated by old data. The method helps to prevent losses and save data simultaneously.

Back to top