I have a JSON dataset coming from a REST query in SharePoint (i.e. all my data is coming from a list). I am currently using tabs through colvisGroup to show different slices of data. To do this I have tabs that a user can click to automatically show the filtered data... I am looking to add a new tab that summarizes all the data in the datatable in one row with multiple summaries shown in columns. The catch is, unlike the total function, this would capture new columns that dont exist in the dataset and run functions like count, min/max, etc.
so lets say i had a data set with rows for apples, oranges and bananas, each has count, expiration date, and store
I want datatables to display a tab that only shows a single summary row that summaries the data in that says, something like "most product", "average expiration date", and "freshest store" (this is all just a super generalized example) -- so this row would then say "Apples" "January 22, 2022" and "Acme"
So this row is doing calculation on multiple different variables and functions of the data set but in of itself isnt a new record. Is this possible?
Before anyone asks -- yes I can do it in a separate javascript function but i was trying to keep things clean and within datatables... I am just getting lost in how.
My thought here is using the table.row.add() function and drawing it. But then im stuck on how the columns line up -- unless i make a bunch of dummy columns. Does anyone have any ideas?