416.467.9100 | Dundas Data Visualization | Login
Welcome Guest
This is the support page for the legacy Dundas Dashboard application. For assistance with the current Dundas BI application please click here.
Dashboard v5.0

This site makes extensive use of JavaScript.

Please enable JavaScript in your web browser and reload the page before proceeding.

Removing Context Menu items

Hide navigation
RSS
Modified on Fri, 06 Dec 2013 10:21 AM

Overview

At viewing time, when you right-click on a dashboard or a control, a context menu is displayed with different options to choose. There may be cases in which these options may not be needed or you don't want the users to be exposed to them. One way to do this is to change the security settings of the users and deny the related permissions. The other way is to do it at runtime using a script as shown in this article.

Context Menu items

Each context menu item is identified by its Name and its Id. The context menu varies between the dashboard canvas and a data control as shown below:


Dashboard
Name  Id 
 Customize  customize_ 
 Annotate  Annotate 
 Manage  ManageContent 
 Bookmark  Bookmark 
 Export  Export 
 Notify  Notification 
 Print  Print 
 Share  Share 
 Performance  PerformanceInfo 

Data Control
Name  Id 
 Annotate...  AnnotateThis 
 Notify...  NotifyOnThis 
 Apply Formula  Formulas 
 Export...  ExportThis 
 Print...  PrintThis 
 Report Customization...  reportCustomizationCommand 

Report Customization... is only available for Analytical Dashboard controls.

Remove specific items

If you want to remove specific items such as Bookmark and Notify options from the dashboard's context menu, use the code below in the dashboard's Context Click Interaction.

var NamesToRemove = new List(); NamesToRemove.Add("Export"); NamesToRemove.Add("Print"); NamesToRemove.Add("Customize"); NamesToRemove.Add("Notify"); NamesToRemove.Add("Share"); NamesToRemove.Add("Performance");

Dictionary map = new Dictionary(); for (int i=0;i< e.ContextCommands.Count;i++) { map.Add(e.ContextCommandsi.Name, e.ContextCommandsi); }

for (int i=0;i< NamesToRemove.Count;i++) { var name = NamesToRemovei; if(map.ContainsKey(name)) { e.ContextCommands.Remove(mapname); } }


You can use the Name also instead of the Id.

e.g., if you want to remove Annotate and Notify from the context menu of a Bar Chart, then use the following code in its Context Click Interaction:

var NamesToRemove = new List(); NamesToRemove.Add("Annotate..."); NamesToRemove.Add("Notify...");

Dictionary map = new Dictionary(); for (int i=0;i< e.ContextCommands.Count;i++) { map.Add(e.ContextCommandsi.Name, e.ContextCommandsi); }

for (int i=0;i< NamesToRemove.Count;i++) { var name = NamesToRemovei; if(map.ContainsKey(name)) { e.ContextCommands.Remove(mapname); } }


If you want to remove more items, then add those related conditions in the "if" statement.



Related topics

About Dundas | Contact Us Follow us on Twitter! | Privacy Statement | Report Site Issues

Copyright © 2009-2014 Dundas Data Visualization, Inc.