datatable custom dynamic column

Hi, I have json data like this
{
field1: TEST1,
field2: TIME1,
field3:resultA,
field4:val
}.
I would like to put field1 and field2 values as column header, is there any way to this in datatable, i try it in pivot and it works but in pivot fields are not editable.
Thanks

Looks like the Pivot is more suitable here, but can you please provide more details on the use-case?

Pivot aggregates the raw data into a completely new dataset that depends on the defined structure. Moreover, the configuration of the grid depends on this parameter.

DataTable is intended for representing the incoming data with the minimal changes (styling, formatting, linking to additional data sources), without calculations of such complexity.

The use-case is to display datas from differents sources in a variable periods,
For the display, pivot is more suitable but the specs needs that fields values to be editable, to be send to the backend calculation.

Pivot Table is a showcase for the result of data aggregation and the cells cannot be editable.

The only way here is to change the structure of the incoming data before it will be parsed to a datatable.

Right now, the data is delivered as columns, right?
The point is that Datatable expects the data as rows.
So if your data items has to be represented as

| TestA		| TestB		|
| TimeA		| TimeB		|
| ResultA 	| ResultB 	|
| ValueA	| ValueB	|

you need to create a custom function that will convert your data to the format like:

{ id:"field1", item1:"TestA", item2:"TestB"},
{ id:"field2", item1:"TimeA", item2:"TimeB"}, // and so on

In general, such convertion is nearly equal to the transpose of a matrix in math.
Also, the needed items (fields 1-2) can be used to configure the column headers/IDs by iterating through keys. Here’s a quick sample: https://webix.com/snippet/cbe4a511