22
Views
5
Comments
Solved
[Data Grid Web] [Data Grid Web] Disable the right click menu items but keep filtering
Question
Forge component by OutSystems R&D
41
Published on 14 Dec 2020

Hi, 


I am working on a project that uses data grid. However, I would like to disable the right-click menu (specifically I want to disable the "insert row", but this seems even harder so disabling the whole thing is ok for me as well) while keeping the filtering functionality. If I understand it correctly, in the Dynamic Row Style example in https://outsystemsui.outsystems.com/DataGridSample/AdvancedSamples.aspx , it disables the right-click menu by setting the Deprecated_SuppressMenu property to True, but it seems that doing so would also disable the filtering. Is there a way to only disable the menu?


Thanks!

Rank: #5582
Solution

Hi,

I have found using an empty context menu with the gridwidgetid  set to the grid id will block any right click functions, I believe it is possible using the context menu to set it up the way you want it but I haven't used this as I block everything

Hope this helps 

Staff
Rank: #871

Hi Yifan Wang 


There is a way to remove specific items from ContextMenu. If you run the following code on Browser's Console GridOS.GridObject[0].menu.options, you will see all the default ContextMenu options. You can just delete the ones you want to remove.


If you need new actions I would say its better to use the ContextMenu and ContextMenuItem from our DataGridComponent. Although doing so all the default options won't be available.


The attached sample has no "Inser Blank rows", check the Javascript from the default page.


Hope to help you solve your issue.

 

DataGridCustomContextMenuIRemove.oml