Skip to content

Commit 32068f3

Browse files
Apply column visibility properly
This fix removes an unneeded additional function when setting column visibility. Since both functions were of the same priority level, it was possible that the visibility that was passed in would be overwritten with the default value of true under certain circumstances. There was really no need for two functions, as this default behavior can be accomplished in one.
1 parent 68681d7 commit 32068f3

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

src/js/core/services/gridClassFactory.js

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -57,23 +57,12 @@
5757

5858
grid.registerColumnsProcessor(function allColumnsVisible(columns) {
5959
columns.forEach(function (column) {
60-
column.visible = true;
60+
column.visible = angular.isDefined(column.colDef.visible) ? column.colDef.visible : true;
6161
});
6262

6363
return columns;
6464
}, 50);
6565

66-
grid.registerColumnsProcessor(function(renderableColumns) {
67-
renderableColumns.forEach(function (column) {
68-
if (column.colDef.visible === false) {
69-
column.visible = false;
70-
}
71-
});
72-
73-
return renderableColumns;
74-
}, 50);
75-
76-
7766
grid.registerRowsProcessor(grid.searchRows, 100);
7867

7968
// Register the default row processor, it sorts rows by selected columns

0 commit comments

Comments
 (0)