Skip to main content
You are viewing help content for a version that is no longer maintained/updated.
All docs
V17.2
  • SaveDashboardExtension.ensureDashboardSaved(Action) Method

    Allows you to invoke a custom function while you save a dashboard.

    Namespace: DevExpress.Dashboard

    Assembly: DevExpress.Dashboard.v17.2.Web.Scripts.dll

    Declaration

    public void ensureDashboardSaved(
        Action action
    )

    Parameters

    Name Type Description
    action Action

    A custom function that is invoked when the dashboard is about to be saved.

    Remarks

    This code sample shows a simple usage of the ensureDashboardSaved method.

    function onBeforeRender(sender, args) {
        var dashboardControl = sender.getDashboardControl();
        var saveExt = dashboardControl.findExtension('save-dashboard');
        saveExt.ensureDashboardSaved(function() { alert("Some text") });
    }
    

    There are four different scenarios of the ensureDashboardSaved method’s behavior in this example.

    Scenario Result
    The dashboard does not have changes. The alert message is displayed.
    The dashboard has changes. In the confirm dialog, you click on the X sign. The alert message is not displayed. The dashboard is not saved.
    The dashboard has changes. In the confirm dialog, you click on the Don’t Save button. The alert message is displayed. The dashboard is not saved.
    The dashboard has changes. In the confirm dialog, you click on the Save button. The alert message is displayed asynchronously after saving. The dashboard is saved.
    See Also