Disable Column Function

Posted by: oskarputraa on 23 August 2019, 8:41 pm EST

  • Posted 23 August 2019, 8:41 pm EST - Updated 3 October 2022, 7:32 pm EST

    Hi,

    I would like to disable column function (Add Column, Remove Column) for column A,B, and C in FlexSheet.

    How could I do that ? Thanks.

    Oskar Putra

  • Posted 26 August 2019, 2:06 am EST

    Hi Oskar,

    You may need to handle the contextmenu event of the FlexSheet and hide the menu options from the DOM according to the right-clicked column:

    fSheet.hostElement.addEventListener('contextmenu', e => {
          var hti = fSheet.hitTest(e);
          var ins = document.querySelector('div [wj-part="insert-columns"]') as HTMLDivElement;
          var del = document.querySelector('div [wj-part="delete-columns"]') as HTMLDivElement;
          var display = null;
          if(hti.col <= 1) {
            display = 'none';
          }
          ins.style.display = del.style.display = display;
    }, true);
    

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

    Regards,

    Ashwin

Need extra support?

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

Learn More

Forum Channels