Hide Rows/Columns permanently

Posted by: dave.welch on 10 November 2020, 3:49 am EST

  • Posted 10 November 2020, 3:49 am EST

    Hi,
    We are hiding the Rows/Columns data based on authorization.
    I am using
    activeSheet.setRowVisible(1, false);
    activeSheet.setRowHeight(1, 0);

    But the users cam right-click and "Unhide" them

    Is there a way to permanently hide them. Not show the rows/cols even the users unhide.

    Please suggest

    Thanks,
    Veerendra.
  • Marked as Answer

    Replied 10 November 2020, 8:35 pm EST

    Hi Veerendra,

    You may remove the unhide option from the code snippet. Please refer to the following code snippet and the attached sample that demonstrates the same.

     let menuData = spread.contextMenu.menuData.filter((item, i) => {
    return (
    item.name !== "gc.spread.unhideRows" &&
    item.name !== "gc.spread.unhideColumns"
    );
    });
    spread.contextMenu.menuData = menuData;


    sample: https://codesandbox.io/s/damp-dawn-ssefp?file=/src/index.js:362-590

    References:

    MenuView Demo: https://www.grapecity.com/spreadjs/demos/features/worksheet/context-menu/extend-context-menu#demo_source_name

    Regards
    Avinash
Need extra support?

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

Learn More

Forum Channels