I'm storing the column widths of my ngx-datatable inside a database. I get these values using an AJAX call.
How can I set these values for the datatable?
What I've tried:
- setting the [width] property on the
<ngx-datatable-column>
element - injecting the datatable as
@ViewChild(DatatableComponent) table: DatatableComponent;
and settingthis.table.bodyComponent.columns[0].width = 500;
I've tried these methods with and withoutthis.table.recalculate();
, but nothing seems to work.
EDIT
I'm using datatable-column
with header-template
and cell-template
.