Because Ext.Direct writes in the background after a timeout, I am perplexed about how to do the following:

1) A user clicks a button to save a form.
2) The button click triggers store.loadData({jsonRoot: form.getValues()})
3) DirectStore automatically writes the record and receives a success code
4) The success of the write triggers a callback to close the form,

My question is: where do I pass this callback to close the window? I am trying to fully integrate my old Ext JS 2.0 app with 3.0, for learning purposes. I know I could use the automatically generated Model.save() function to save the data but I want the store to be updated at the same time.

How do I callback from the save?

Thanks,

Jesse.