diff app.js @ 122:a7bfaeb1655d

Cleanup part three. Reenabled Zusatzwerte and implemented sending nested data.
author Torsten Irländer <torsten.irlaender@intevation.de>
date Fri, 21 Jun 2013 16:56:17 +0200
parents c05fda928b82
children 747d488b9203
line wrap: on
line diff
--- a/app.js	Fri Jun 21 16:55:23 2013 +0200
+++ b/app.js	Fri Jun 21 16:56:17 2013 +0200
@@ -27,11 +27,31 @@
     // first before the application "launch" function is called.
     controllers: [
         'Sql',
-        'Proben'
+        'Proben',
+        'Zusatzwerte'
         //'Kommentare',
         //'Sql',
-        //'Zusatzwerte',
         //'Orte',
         //'Messungen'
     ]
 });
+
+Ext.data.writer.Json.override({
+    getRecordData: function(record, getEverything) {
+        if(this.writeEverything || record.writeEverything){
+            console.log('getRecordData', this,arguments);
+            return record.getAllData();
+        } else {
+            return this.callOverridden(arguments);
+        }
+    }
+});
+
+Ext.data.Model.addMembers({
+    getAllData: function() {
+        var data1 = this.getData();
+        var data2 = this.getAssociatedData( );
+        var dataMerged = Ext.Object.merge(data1, data2);
+        return dataMerged;
+    }
+});

http://lada.wald.intevation.org