[Lada-commits] [PATCH 5 of 9] Added function to dynamically add columns to the probenlist

Wald Commits scm-commit at wald.intevation.org
Tue Jul 23 11:46:33 CEST 2013


# HG changeset patch
# User Torsten Irländer <torsten.irlaender at intevation.de>
# Date 1374571803 -7200
# Node ID f57b496b4caa205c1493ee2781129690d84ae4c8
# Parent  2a23fcca8ead2649b1a919090266d3936cbb307c
Added function to dynamically add columns to the probenlist.

diff -r 2a23fcca8ead -r f57b496b4caa app/view/proben/List.js
--- 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);
     }
 });


More information about the Lada-commits mailing list