How to hide/disable Save button on edit dialog

I am trying to find a way that I can programmatically hide or disable the Save button on the edit dialog (using a template).

In my actionComplete() function, I have the following code as my attempt (of course it doesn't work):

Snippet
if (args.dialog.btnObj[0]) {
    args.dialog.btnObj[0].visible = false;
}

Any assistance would be appreciated.

IMHO, I really do not understand why SyncFusion has made it so difficult to locate the information for this sort of standard customization.

Marc.


2 Replies

MG Marc Gervais October 20, 2023 03:44 PM UTC

Ok...so after a bit more trial and error, it ends up I was very close. Here is what my solution was:

Snippet
if (args.dialog.btnObj[0]) {
    args.dialog.btnObj[0].disabled = true;
}

Cannot seem to find a way to hide it, but disabling is acceptable for my use case.

Thanks.

Marc.



HS Hemanthkumar S Syncfusion Team October 25, 2023 04:15 AM UTC

Hi Marc Gervais,


Greetings from Syncfusion support.


Query: Cannot seem to find a way to hide it


To achieve your requirement of hiding the button, we recommend setting the style.display property of the button element to 'none'. This will make the button invisible and effectively hide it from view.


For more information, please refer to the below code example.


if (args.dialog.btnObj[0]) {

    args.dialog.btnObj[0].element.style.display = 'none';

}


Regards,

Hemanth Kumar S


Loader.
Up arrow icon