tabulator

Setting header to the Calculation sum


I'm using Tabulator 4.9. I set up a table with topCalc:sum. Now I want to add on a column that has no calculation a text stating "Sum". I can do that by modifying the cell with the text using Javascript.

Once I edit a field value of o cell in tried to use the cellEdited callback to handle the recalculation. But apparenty the sum is written after this callback to the table and my text disapears.

Is there a way to get hold of the topCalc and add the text afterwards?

User id score
Sum 20
user1 1 10
user2 2 10

after editing it looks like

User id score
25
user1 1 15
user2 2 10

Solution

  • ok, so if I understand you correctly (without any code examples to go by) you ARE using topCalc:"sum" on your field:"score" column, and want to put the string "Sum" in the topCalc aread of your field:"user" column ?

    If so, look at Custom Calculator Functions for your field:"user", just return the string "Sum"