Hello all,
I need some help regarding Datagrid. If anyone has worked on it or know any working solution, please guide.
Following is the scenario: In Datagrid we have a default menu (ContextMenu) which opens when right clicked. But we want the same menu Opens on left click of an icon. Icon is present in Action column Following is the screenshot for reference.
Hello,
Maybe there's an easier way, but the only way I could find to do this is via JavaScript. This is how I set up the ActionColumn to show the icon:
And this is my client action and JavaScript:
The JavaScript code:
var element = document.getElementById($parameters.GridWidgetId).querySelector('.datagrid-runtime');var button = document.querySelector('.wj-state-selected .icon');var evt = new MouseEvent("contextmenu", { clientX: button.getBoundingClientRect().x, clientY: button.getBoundingClientRect().y});element.dispatchEvent(evt);
Hello
Appreciate your help.
Can you please suggest how can I disable Right Click inside Grid.
Thanks
Nihil
hello
Actually this Java script is only working on first row icon.
Hi,
It should work for all rows of the DataGrid. I've tested it myself. Here's a module with my implementation for reference.