- autoSave: true, // <-- false would delay executing create, update, destroy requests until specifically told to do so with some [save] buton.
- listeners: {
- write : function(store, action, result, res, rs) {
- App.setAlert(res.success, res.message); // <-- show user-feedback for all write actions
- },
- exception : function(proxy, type, action, options, res, arg) {
- if (type === 'remote') {
- Ext.Msg.show({
- title: 'REMOTE EXCEPTION',
- msg: res.message,
- icon: Ext.MessageBox.ERROR,
- buttons: Ext.Msg.OK
- });
- }
- }
- }
+ autoSave: true // <-- false would delay executing create, update, destroy requests until specifically told to do so with some [save] buton.
+});
+
+// load the store immeditately
+store.load();
+
+////
+// ***New*** centralized listening of DataProxy events "beforewrite", "write" and "writeexception"
+// upon Ext.data.DataProxy class. This is handy for centralizing user-feedback messaging into one place rather than
+// attaching listenrs to EACH Store.
+//
+// Listen to all DataProxy beforewrite events
+//
+Ext.data.DataProxy.addListener('beforewrite', function(proxy, action) {
+ App.setAlert(App.STATUS_NOTICE, "Before " + action);