In my tree-grid, the child nodes have additional columns. If any of the children are expanded, I want to have the extra columns added. I tried to update the columns on click like so:
function updateColDefs(expanded) {
var cols = expanded ? $scope.col_defs_expanded : $scope.col_defs;
$scope.columns = [];
cols.forEach(function(c) {
$scope.columns.push(c);
});
};
Just add a watch in the JS file like below:
scope.$watch('colDefs', function (newValue, oldValue) { if (newValue != oldValue) { scope.colDefinitions = scope.colDefs; } });
In my tree-grid, the child nodes have additional columns. If any of the children are expanded, I want to have the extra columns added. I tried to update the columns on click like so:
But this doesn't seem to change the view.