diff app/view/proben/List.js @ 239:f57b496b4caa

Added function to dynamically add columns to the probenlist.
author Torsten Irländer <torsten.irlaender@intevation.de>
date Tue, 23 Jul 2013 11:30:03 +0200
parents 2a23fcca8ead
children c8c53f162a22
line wrap: on
line diff
--- a/app/view/proben/List.js	Tue Jul 23 11:29:37 2013 +0200
+++ b/app/view/proben/List.js	Tue Jul 23 11:30:03 2013 +0200
@@ -38,5 +38,18 @@
         ];
         this.columns = [];
         this.callParent(arguments);
+    },
+    setupColumns: function(colnames) {
+        var cols = []
+        for (var i = colnames.length - 1; i >= 0; i--){
+            col = colnames[i];
+            for (var j = this.availableColumns.length - 1; j >= 0; j--){
+                defaultCol = this.availableColumns[j];
+                if (defaultCol.dataIndex === col) {
+                    cols.push(this.availableColumns[j])
+                };
+            };
+        };
+        this.reconfigure(this.store, cols);
     }
 });

http://lada.wald.intevation.org