ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anovi...@apache.org
Subject [1/2] ignite git commit: IGNITE-843 Fixed hide system columns.
Date Fri, 25 Sep 2015 04:09:01 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-843 31cda5a6e -> 3f29a19a7


IGNITE-843 Fixed hide system columns.


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/9bba7b1b
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/9bba7b1b
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/9bba7b1b

Branch: refs/heads/ignite-843
Commit: 9bba7b1b691ebae6dda46632d02a173e62e20b4b
Parents: e6991b8
Author: Andrey <anovikov@gridgain.com>
Authored: Fri Sep 25 11:09:00 2015 +0700
Committer: Andrey <anovikov@gridgain.com>
Committed: Fri Sep 25 11:09:00 2015 +0700

----------------------------------------------------------------------
 .../src/main/js/controllers/sql-controller.js   | 36 ++++++++++++++------
 1 file changed, 25 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/9bba7b1b/modules/control-center-web/src/main/js/controllers/sql-controller.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/controllers/sql-controller.js b/modules/control-center-web/src/main/js/controllers/sql-controller.js
index 42f0f85..3574aeb 100644
--- a/modules/control-center-web/src/main/js/controllers/sql-controller.js
+++ b/modules/control-center-web/src/main/js/controllers/sql-controller.js
@@ -329,6 +329,23 @@ controlCenterModule.controller('sqlController',
         paragraph.systemColumns = !paragraph.systemColumns;
 
         paragraph.columnFilter = _columnFilter(paragraph);
+
+        var columnDefs = [];
+
+        _.forEach(paragraph.meta, function (meta, idx) {
+            if (paragraph.columnFilter(meta)) {
+                columnDefs.push({
+                    headerName: meta.fieldName,
+                    valueGetter: 'JSON.stringify(data[' + idx + '])'
+                });
+            }
+        });
+
+        paragraph.gridOptions.api.setColumnDefs(columnDefs);
+
+        setTimeout(function () {
+            paragraph.gridOptions.api.sizeColumnsToFit();
+        }, 1);
     };
 
     function _retainColumns(allCols, curCols, dfltIdx) {
@@ -374,18 +391,15 @@ controlCenterModule.controller('sqlController',
 
                 var columnDefs = [];
 
-                var idx = 0;
-
-                _.forEach(res.meta, function (meta) {
-                    columnDefs.push({
-                        headerName: meta.fieldName,
-                        valueGetter: 'JSON.stringify(data[' + idx + '])'
-                    });
-
-                    var col = {value: idx++, label: meta.fieldName};
+                _.forEach(res.meta, function (meta, idx) {
+                    if (paragraph.columnFilter(meta)) {
+                        paragraph.chartColumns.push({value: idx + 1, label: meta.fieldName});
 
-                    if (paragraph.disabledSystemColumns || _hideColumn(meta))
-                        paragraph.chartColumns.push(col);
+                        columnDefs.push({
+                            headerName: meta.fieldName,
+                            valueGetter: 'JSON.stringify(data[' + (idx) + '])'
+                        });
+                    }
                 });
 
                 paragraph.gridOptions.api.setColumnDefs(columnDefs);


Mime
View raw message