Hide/show columns
There is any way to hide or show columns after the table has been rendered?
I know it is possible using fnSetColumnVis from oInstance, but it will be perfect if I could use this feature from DTColumnBuilder, ex:
//columns definition
$scope.dtColumns = [
DTColumnBuilder.newColumn('...')...
...
];
//so this command
$scope.dtColumns[0].setVisible(false);
$scope.dtColumns[3].setVisible(true);
Tks
I think the best way is to use the colVis plugin. You won't need to define manually in the code which column is visible or not.
I forgot to mention the colVis!
I don't would like to use the colVis, I think it is low customizable, at least, I couldn't custom it my way.
You can do it directly by setting the visible to false:
$scope.dtcolumns[0].visible = false;
$scope.dtcolumns[3].visible = true;
Angular-datatables can change the options seamessly.
:(
It doesn't worked for me!
2014-11-05 17:44 GMT-02:00 Louis LIN [email protected]:
You can do it directly by setting the visible to false:
$scope.dtcolumns[0].visible = false; $scope.dtcolumns[3].visible = true;
Angular-datatables can change the options seamessly.
— Reply to this email directly or view it on GitHub https://github.com/l-lin/angular-datatables/issues/117#issuecomment-61868929 .
Att. Giolvani de Matos
Mmh looks like it's only working with columnDef...
Fixed on the upcoming version 0.4.0.
How to get this change I am also stuck on this
The v0.4.0 is not out yet. But the changes are all in the dev branch.
Thanks :) any expected date for v0.4.0 ?
There are still some issue to deal with. So it will be out when there are done.
I tried this approach, but for whatever reason I couldn't figure out,
the first time you do $scope.dtcolumnDef[0].visible = false; it works perfect and pretty quick, but when you try to do it again, it's extremely slow, ex. taking more than 1 seconds.
i have try this '$scope.dtcolumns[0].visible = false;' but getting error. i want to column hide and show on conditionally how can do any idea?
@Coderwill Worked for me.. you need to capitalize the "c" in columns. vm.dtColumns[0].visible = false;