Ticket T979479
Visible to All Users

Web Dashboard - Dashboard Save event

created 4 years ago (modified 4 years ago)

[DevExpress Support Team: CLONED FROM T379075: Dashboard Save Event In web ]

Dear DevExpress Support,

was there any progress made since the last update of this ticket?
Is there a solution to be notified when a dashboard (JS with Asp.Net Core backend) is saved?

Answers approved by DevExpress Support

created 4 years ago (modified 4 years ago)

Hi Kevin,

There is no built-in functionality to handle the dashboard save event on the client side. As a possible solution, create a custom Save button by implementing a dashboard extension. Refer to the following help topic where you can find an example of a custom Save As extension: Extensions Overview.

I look forward to your results.

UPDATED:

There is no simple way to do this. As a possible workaround, you can override the SaveDashboardExtension.performSaveDashboard method.

For instance, see the code below:

JavaScript
var saveDashboard = dashboardControl.findExtension('saveDashboard'); var originalPerformSaveDashboard = saveDashboard.performSaveDashboard; saveDashboard.performSaveDashboard = function (dashboardId, dashboardJson) { var performSave = originalPerformSaveDashboard.bind(saveDashboard); return performSave(dashboardId, dashboardJson).then(function () { console.log('dashboard saved'); }); };
    Show previous comments (3)
    Sergi (DevExpress) 4 years ago

      Hello,

      The new save-button is always enabled. The default one is only enabled when there were actual changes. How do I implement that?

      You can use the UndoRedoExtension.isChanged property to determine if a dashboard has changes. Refer to the following ticket where we discussed a similar scenario: Web Dashboard Designer - How to implement AutoSave feature to save dashboards once any property is changed.

      Only the newly created button triggers my action. Other ways to save the dashboard are untouched. How do I get to them?

      There is no simple way to do this. As a possible workaround, you can override the SaveDashboardExtension.performSaveDashboard method.

      For instance, see the code below:

      JavaScript
      var saveDashboard = dashboardControl.findExtension('saveDashboard'); var originalPerformSaveDashboard = saveDashboard.performSaveDashboard; saveDashboard.performSaveDashboard = function (dashboardId, dashboardJson) { var performSave = originalPerformSaveDashboard.bind(saveDashboard); return performSave(dashboardId, dashboardJson).then(function () { console.log('dashboard saved'); }); };

      I look forward to your results.

      KR KR
      Kevin Reinhold 4 years ago

        Thank you very much. This was the answer I was hoping for. Implementing this piece of code makes the additional or custom save-button completely obsolete. If ran before rendering of the DataGrid the function containing the console.log([...]); can hold anything I want which results in the event-like behaviour I asked for initially. Now my code works perfectly fine in every case I tried.

        Sergi (DevExpress) 4 years ago

          Hi Kevin,

          I am happy to hear that the issue has been resolved. Feel free to contact us in the future. We will be happy to assist you.

          Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

          Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.