Enable/disable entire ribbon

Posted by: damian.szwajkos on 27 April 2022, 6:21 am EST

  • Posted 27 April 2022, 6:21 am EST

    Hello,

    Are we able to disable/enable entire ribbon dynamically at once in SpreadJS Designer?

    Regards

    Damian Szwajkos

  • Posted 28 April 2022, 7:24 am EST

    hi,

    You may use the following code snippet to achieve this functionality. Please refer to the following code snippet and let me know if you face any issues.

    
    document.getElementById("check").addEventListener("change", (e) => {
      let ribbon = document.querySelector(".ribbon");
      ribbon.style.display = e.target.checked ? "block" : "none";
      designer.getWorkbook().refresh();
    });
    
    
    

    sample: https://codesandbox.io/s/spread-js-starter-forked-2r61fj?file=/src/index.js:2661-2882

    Regards,

    Avinash

Need extra support?

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

Learn More

Forum Channels