Flexmonster provides a context menu for the grid’s and chart’s elements where you can drill through values, open filters, or change aggregations. This tutorial explains how the context menu can be customized to provide new functionality.
The context menu can be customized via the customizeContextMenu API call.
customizeContextMenu
returns an array of objects, each of which describes a context menu item. Certain items can be removed by deleting the corresponding object from the array. The following example removes all context menu items:
flexmonster.customizeContextMenu(function(items, data, viewType) { return []; });
The following code will add a new item to the flat table context menu:
flexmonster.customizeContextMenu(function(items, data, viewType) { if (viewType == "flat") items.push({ label: "Switch to charts", handler: function() { flexmonster.showCharts(); } }); return items; });
Check out a full description of the customizeContextMenu parameters.
You may be interested in the following articles: