Skip to content
Advertisement

Tabulator processing ajax data before load

I need help if it is possible to modify table data before load into table in Tabulator library. I need to convert decimal value of (8 poles)DIP switch to separate 8 bits and load it to table. I have data in json format like this:

JavaScript

and I would like format data to this (for decimal value 15):

JavaScript

to this table:

JavaScript

I know how to extract each bit in c:

JavaScript

but I dont know how to do this when data are loaded into table using ajax.

Can somebody help how to do it please?

I am newbie and I cant help myself.

Thank you!

Advertisement

Answer

You can spread the switches to a separate bit values like that:

JavaScript

Then, you should be able to use the content transformed as the table data like that (see http://tabulator.info/docs/4.9/data):

JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement