It seems that we cannot hide specific columns, like what If we have an array that contains 4 properties and we want to display only three while hiding the fourth one dynamically based on $watch or some other sort of tool.
did you try using header-class="myHideClass" attribute?
It works with this:
...
<table ng-table="tableParams" ...
...
<td ng-show="tableParams.myShowFlag">
...
...
getData: function ($defer, params) {
params.myShowFlag = false;
...
}
...
Thank you very much zdila this work for me.
I wanted to hide a column, but I wanted to extract it into a CSV with ng-table-to-csv, so I used @zdila's solution and, as suggested by @zeitos, I have added an header-class to hide the header.
This way my column is on the DOM, but not visible and it's present on my CSV.
<td ng-show ="cashFlowsTable.myShowFlag" data-title="'Debito Residuo a decorrenza'" header-class="'ng-hide'">{{::cashFlow.debResd}}</td>
Most helpful comment
It works with this: