Hi.
I need to reset a datatable to a state in which it has no columns. I’ve tried:
table.config.columns = [];
table.refreshColumns();
and
table.refreshColumns([]);
also
var columns = webix.toArray(table.config.columns);
var col_length = columns.length;
for(i=0; i< col_length; i++){
columns.removeAt(0);
}
$$('importar_dt').refreshColumns();
None of these work. When the columnconfig array is empty, refreshColumns does nothing.
Any solution short of deleting the table and re-creating it?
As far as I can see, it works:
http://webix.com/snippet/a07ca5fa
Could you please provide a demo?
Seems to be a version thing. In 3.1, the columns don’t disappear.
However:
http://webix.com/snippet/ca8fdbb0
Even in 4.0, that blue header bar is still there and so are the horizontal scrollbars. In my local files (loaded that latest version to test it), the vertical scrollbars are also still present.
It’s a normal behavior, as the header won’t be updated without columns configuration. As a solution, you can customize the style of the disabled datatable add apply table.disable()
:
http://webix.com/snippet/968f5c4a