Get Free Trial
Get Free Trial

How to hide right clic menu on rows

Patrick TAVARIS asked on December 11, 2019

I’m trying to hide right click on rows (see attached image).
I’ve put showHeaders and showFilters to “false” (under grid option) but the right click on a column let me filter anyway. I think I’m missing an option doesn’t it ?
It seems I have to use :
But I can’t see an example with the “default” full options filled (to let me start with it and customize only options I don’t want to see)

4 answers

Illia Yatsyshyn Illia Yatsyshyn Flexmonster December 11, 2019

Hello, Patrick,
Thank you for reporting about the inconsistent behavior of the showFilters property. We would like to announce that the property set to `false` will also hide the filter controls placed in the context menu with the minor update ETA 13.01.20.
For now, as a workaround, we would like to suggest using the following workaround: hide appropriate tabs of the menu using the customizeContextMenu method. Our team has prepared the function satisfying your needs:

flexmonster.customizeContextMenu(function(items, data, viewType) {  
if (data.type == "header" && !data.isGrandTotal) {    
if (data.member != null)      items.splice(3, 1);    
else items.splice(0, 1);  
return items;

The function allows hiding filter control tabs inside the context menu whether or not the showFilters is set to false or not.
Also, check out an example demonstrating the result of the function above.
We hope it helps.
Please, contact us in case additional questions occur.
Kind Regards,

Patrick TAVARIS December 11, 2019

Thanks for the reply. I would highly suggest to add options like “showFilters” to “showXX” :

  • agregation
  • see through (in french “percer dans”)
  • and other “customization” options available in the context menu

As the index items are not in an hashmap such as “filterOption” => …, and that this index change depending on type or use case, it is quite unnecessarily complicated to manage all the use cases.
If there was additional “showXX” options, that also work for contextMenu AND toolbar, it could be great…
I hope it could help

Illia Yatsyshyn Illia Yatsyshyn Flexmonster December 13, 2019

Hello, Patrick,
Thank you for your feedback.
Our team would like to kindly recommend checking out drillThrough and showAggregations properties of the options object. Named properties allow removing dedicated UI controllers both from the Toolbar and from the context menu.
More information about options object and its properties can be found by the following link:
Other elements of the context menu can be manually hidden in the menu itself and from the Toolbar in case they are doubled in it.
For example, controllers dedicated to formatting can be removed from the context menu using customizeContextMenu API call and from the Toolbar using the beforetoolbarcreated event.
Please check out the following tutorials, which can turn out useful for you: customize context menucustomize the Toolbarbeforetoolbarcreated event.
We hope it works for you.
Best regards,

Illia Yatsyshyn Illia Yatsyshyn Flexmonster 7 days ago

Hello, Patrick,
We are glad to inform you that the issue when grid.showFilter option does not disable filtering options in the context menu was fixed.
This is provided in the 2.7.23 version of Flexmonster:
You are welcome to update the component. Here is our updating to the latest version tutorial for guidance: 
Please let us know if everything works.
Best regards,

Please login or Register to Submit Answer