Configure datatable columns prior to parse

Hello,

I’m trying to configure datatable columns dynamically, rather than statically type all of the columns. So I’d like to use the url method of datatable to load data, but I’m not sure how to access/configure the columns prior to loading/parsing.

Does anyone know how this can be done?

Thanks

I think you may be looking for “scheme”:
https://docs.webix.com/desktop__data_scheme.html

There’s a usage example 1/3 way down on the page showing how to work it with the datatable.

Hope it helps.

This won’t work as I need to pull the data from the server, then once it hits the client, dynamically create the column headers/settings.

try to use onStructureLoad event and reconfigure columns as you need
https://docs.webix.com/api__ui.datatable_onstructureload_event.html

Thanks @intregal, I’ll give it a try

@intregal - Unfortunately, this did not work as onStructureLoad does not return the data.

in onStructureLoad event columns have already been created.
you just need to reconfigure them - change title, set filter, remove unrequired, add custom columns.
to get data, use table.data

@intregal - thanks, that’s definitely a solution, but there isn’t a way to do this prior to the columns being initialized? It seems inefficient to do this. I’m sure the UX performance degradation is minimal, but I would think there would be a way around this.

this event is exactly for this purpose and there will be no performance degradation. you will not even have to call refreshColumns.