ASPxClientWebDocumentViewer.CustomizeMenuActions Event
Enables you to customize the Web Document Viewer’s menu actions.
Namespace: DevExpress.XtraReports.Web.Scripts
Assembly: DevExpress.XtraReports.v17.2.Web.Scripts.dll
Declaration
public event ASPxClientWebDocumentViewerCustomizeMenuActionsEventHandler CustomizeMenuActions
Event Data
The CustomizeMenuActions event's data class is ASPxClientCustomizeMenuActionsEventArgs. The following properties provide information specific to this event:
Property | Description |
---|---|
Actions | Provides access to the collection of actions available in the toolbar and menu. |
The event data class exposes the following methods:
Method | Description |
---|---|
GetById(String) | Returns a menu action with the specified ID. |
Remarks
The ASPxClientCustomizeMenuActionsEventArgs.Actions property of an event argument provides access to all commands available in the Web Document Viewer’s Toolbar. To obtain an existing command, use the ASPxClientCustomizeElementsEventArgs.GetById method.
The code below demonstrates the CustomizeMenuActions event handler that hides an existing command and registers a custom one.
function CustomizeMenuActions(s, e) {
var actions = e.Actions;
// Get the "Print Page" action and hide it.
var printPageAction = e.GetById(DevExpress.Report.Preview.ActionId.PrintPage);
if (printPageAction)
printPageAction.visible = false;
// Add a new action.
actions.push({
text: "Custom Command",
imageClassName: "customButton",
hasSeparator: false,
disabled: ko.observable(false),
visible: true,
hotKey: { ctrlKey: true, keyCode: "Z".charCodeAt(0) },
clickAction: function () {
alert('Clicked.');
}
})
};
For more information, see Customizing the Document Viewer Toolbar in ASP.NET .