Update treetable totals when figures change in cell

How does one update the treetable header row total/s after the figure in a cell is edited and changed?

Tagged:

Comments

  • edited March 2019

    Managed to work it out. Code is place in onAfterEditStop method.

    var difference = state.value - state.old;
    var parentId = "";
    var parentRecord = "";
    var currentValue = 0;

    //Update parent
    do {
    parentId = parentId == "" ? this.getParentId(editor.row) : this.getParentId(parentId);
    parentRecord = this.getItem(parentId);
    currentValue = parentRecord[editedDay];
    parentRecord[editedDay] = currentValue + difference;
    }
    while (parentRecord.$level > 1);

  • edited March 2019

    .

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion