ASPxClientReportDesigner.CustomizeMenuActions Event

Enables you to customize the Web Report Designer's menu actions.

Namespace: DevExpress.XtraReports.Web.Scripts

Assembly: DevExpress.XtraReports.v18.1.Web.Scripts.dll

Declaration

public event ASPxClientReportDesignerCustomizeMenuActionsEventHandler CustomizeMenuActions
Public Event CustomizeMenuActions As ASPxClientReportDesignerCustomizeMenuActionsEventHandler

The event handler receives an argument of the ASPxClientReportDesignerCustomizeMenuActionsEventHandler type.

The ASPxClientCustomizeMenuActionsEventArgs.Actions property of an event argument provides access to all commands available in the Report Designer Toolbar. To obtain an existing command, use the ASPxClientCustomizeElementsEventArgs.GetById method. Refer to Report Designer's Client-Side API for a complete list of available commands.

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 "Save" action and hide it
    var saveAction = e.GetById(DevExpress.Designer.Report.ActionId.Save);
    if (saveAction)
       saveAction.visible = false;

    //Add a new action
    actions.push({
        text: "Custom Command",
        imageClassName: "customButton",
        disabled: ko.observable(false),
        visible: true,
        hasSeparator: true,
        // The clickAction handler receives the client-side report model 
        // allowing you interact with the currently opened report on the client. 
        clickAction: function (report) {
            alert('Clicked');
        },
        hotKey: { ctrlKey: true, keyCode: "Z".charCodeAt(0) },
        container: "toolbar"
    });
}

For more information, see the Customize the Report Designer Toolbar document.

See Also