Flexgrid itemFormatter cells do not update columnFooter

Posted by: david.hettmer on 18 June 2020, 9:43 am EST

  • Posted 18 June 2020, 9:43 am EST - Updated 3 October 2022, 4:07 pm EST

    I am currently working on a flexgrid with formatted cells that is aggregated. On initial load, it is showing the total values of the column (aggregate=‘Sum’). However, when I change the value of one cell on that column, the column footer does not update. Kindly refer to the attached screenshots:

    itemFormatter code:

    formatInputCells(grid: WjFlexGrid) {
        grid.formatItem.addHandler((s, e: wjcGrid.FormatItemEventArgs) => {
          if(e.panel.cellType === 1 && e.col > 4) {
            let html = e.cell.innerHTML;
            e.cell.innerHTML = "<input type='number' value='"+ html +"'>";
            wjcCore.setCss(e.cell, {
              display: 'table',
              tableLayout: 'fixed',
              padding: 0 // TFS 334754
            });
    
            wjcCore.setCss(<HTMLElement>e.cell.children[0], {
              height: '24px',
              width: '80px',
              margin: '5px 8px',
              textAlign: 'right',
              border: '1px solid rgb(213, 212, 217)',
              borderRadius: '2px',
              color: 'rgb(33, 33, 33)',
              padding: '5px 4px'
            });
          }
        });
      }
    
  • Posted 19 June 2020, 4:39 am EST

    Hi David,

    The value of the footer is not updating because the value of the cell is not updating. Even if you will update the value of the input element, the cell bound to the input element will not be updated. You will need to add an event listener on the input element that will update the value of the cell.

    Please refer to the sample link below for reference:

    https://stackblitz.com/edit/angular-z8ujch

    Regards,

    Ashwin

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels