Ng-table: Hide specific columns

Created on 1 Sep 2014  ·  5Comments  ·  Source: esvit/ng-table

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.

Most helpful comment

It works with this:

...
<table ng-table="tableParams" ...
  ...
  <td ng-show="tableParams.myShowFlag">
  ...
...
getData: function ($defer, params) {
  params.myShowFlag = false;
  ...
}
...

All 5 comments

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>

Was this page helpful?
0 / 5 - 0 ratings

Related issues

richtmat picture richtmat  ·  7Comments

andreicristianpetcu picture andreicristianpetcu  ·  6Comments

alienriquebm picture alienriquebm  ·  6Comments

esvit picture esvit  ·  37Comments

raul1991 picture raul1991  ·  6Comments