Ticket T948400
Visible to All Users

DataGrid - Batch Edit - How to disable a button if there are changes pending

created 4 years ago

Hello,

I need to disable the 'Next' button if there are pending changes.

Then after the changes are saved successfully, I need to enable it.

This will force the users validate they save their changes.

What is the best way to update this?

Seems like editing has a new property for change, but not sure it is allowed in 20.1.7.

Also is there a value that is set on the Dx Data Grid that is toggle based on if there are changes?

Here is a screen shot:

Clipboard-File-1.png

Comments (1)

    I found this:

    https://js.devexpress.com/Documentation/ApiReference/UI_Widgets/dxDataGrid/Methods/#hasEditData

    Which works, but is there an event where I can actually disable it if there are pending changes?

    Answers approved by DevExpress Support

    created 4 years ago

    Hello,

    The editing.changes property is available in v20.2.

    DataGrid doesn't have an event to indicate that there were pending changes. You can use the onValueChanged event handler of your DataGrid editors (see onEditorPreparing) to disable the "Next" button. When data is saved, enable the button.

    Another solution is to regularly check whether your DataGrid has unsaved data by using the hasEditData method in the setInterval function and enable or disable your button accordingly.

    Regards,
    Romeo

      Comments (1)

        Thanks! This helps!

        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.