Sum the totals in the header row

I have columns Monday to Sunday. The header of each row contains the total hours worked for each day. There is a column after the Sunday column to place the total hours for the week.

What code needs to go into the ‘webix.ui.datafilter.totalWeek’ to be able to accomplish this?

Hello,

To get the total value of some column you can use the summColumn counter: Math Operations of DataTable, Operations with Data Webix Docs
! But, the counter is added to the footer of a column (can’t be used in the header)

There is a column after the Sunday column to place the total hours for the week

You can use scheme as described here

Sample: Code Snippet

Hi Nastja,

Thanks for the input. Note the following:

  • The day totals are in the header cells of the data table.
  • The weekly total is also in the header cell of the data table.

I have a working solution whereby I used the { content: “totalColumn” } for each days total to increment a variable. That variable value was then fed into the datafilter below:

    webix.ui.datafilter.totalWeek = webix.extend({
        refresh: function (master, node, value) {
            node.firstChild.innerHTML = total;
        }
    }, webix.ui.datafilter.summColumn);