I want to hide/show columns of a datatable and save the configuration.
- Hide/Show
Hide/Show is easy, but there is no toogle function.
- Reading the column width and hidden-attribut.
I can iterate over the Config of the datatable, but hidden columns are removed from the list.
table.config.columns
My Workaround: I use the column-names seperate and this workaround …
d= webix.$$("my_datatable");
for (var i = 0; i<names.length; i++) {
hidden = false;
if (d.getColumnIndex(names[i])==-1) {
d.showColum(names[i]);
hidden = true;
}
width = d.config.columns[d.getColumnIndex(names[i]].width;
if (hidden) { d.hideColumn(names[i]); }
}
Is there a better solution to get hidden/width attribute from a datatable?