Is Context Menu feature available for DVJs?

Posted by: nchalla on 17 October 2019, 5:13 pm EST

    • Post Options:
    • Link

    Posted 17 October 2019, 5:13 pm EST

    Is Context Menu feature available for DVJs?

  • Posted 20 October 2019, 7:47 pm EST

    Hi,

    There is no inbuilt support for context menu but we could easily create a context menu for the DVJS by handling the contextmenu event on its container. Please refer to the following code snippet and the sample demonstrating the same:

    dv.container.addEventListener("contextmenu", e => {
      let htinfo = dv.hitTest(e);
      if (!htinfo || htinfo.area !== "viewport") {
        return;
      }
      showContextMenu(e, dv, htinfo);
      e.preventDefault();
    });
    

    https://codesandbox.io/s/dvjs-sample-4x7n9

    Regards

    Sharad

Need extra support?

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

Learn More

Forum Channels