FlexSheet Row Header Visibility, Row Numbering Start from 2

Posted by: oskarputraa on 19 August 2019, 4:09 pm EST

    • Post Options:
    • Link

    Posted 19 August 2019, 4:09 pm EST - Updated 3 October 2022, 10:36 am EST

    Hi,

    After I set row header visibility to false, row numbering start from 2, could you help to make it start from 1 instead of 2 ?

    self.formatSheet.rows[0].visible = false;
    

    Thanks.

    Oskar Putra

  • Posted 19 August 2019, 5:03 pm EST

    Hi Oskar,

    You may use the CellFactory class to update the numbering on the Row Headers of FlexSheet just like we did with the Column Headers. Please refer to the code snippet below:

    let oldUpdateCell = formatSheet.cellFactory.updateCell;
    formatSheet.cellFactory.updateCell = function (panel, row, col, cell, rng, update) {
          oldUpdateCell.call(this, panel, row, col, cell, rng, update);
          if (panel == formatSheet.rowHeaders) {
            cell.innerHTML = row == 0 ? '' : row.toString();
          }
    }
    

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

    Regards,

    Ashwin

  • Posted 19 August 2019, 5:19 pm EST

    Great, thanks

Need extra support?

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

Learn More

Forum Channels