PDA

View Full Version : Grid and batchSave



MiamiCoder
6 May 2009, 12:14 PM
Can anybody provide a simple example highlighting the use of batchSave?

dj
6 May 2009, 4:38 PM
Sorry no example, but... You have seen the writer example in the Ext 3 download? Just change batchSave to true there and see for yourself.

I use batchSave with an Ext.Direct proxy/writer in a situation where I want the user to be able to create/modify several records at once and when he is done, commit them all at once -- or cancel his modifications. It's useful for master-detail kind of relations.

Here is the handler for the save button:


onSaveLinkBtnClick: function(){
if (this.linkForm.links.store.save()) {
this.linkForm.hide();
}
else {
Ext.MessageBox.alert('Error', 'There are validation errors');
}
}