We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Change default message when editing protected cells

In the spreadsheet with protection on 

SS.protectSheet("Sheet1", {
selectCells: true,
formatCells: false,
formatRows: false,
formatColumns: false,
insertLink: false
})


a modal dialog is displayed whenever the user attempts to edit a locked cell,  "The cell you're trying to change is protected...."  How can I avoid that message?  I'd rather the cell value just remain unchanged, or disallow the editor "focus" or edit mode.  

The modal dialog is too disruptive to the UX.  Suggestions




1 Reply

SP Sangeetha Priya Murugan Syncfusion Team March 16, 2023 08:50 AM UTC

Hi John,


Your requirement can be achievable by using the dialogBeforeOpen event. In this you can prevent the dialog opening by setting the args.cancel property as true. And change the default dialog content by using content property. Please find the sample link below.


Sample Link:  https://stackblitz.com/edit/kujatw?file=package.json,index.ts


API Link: https://ej2.syncfusion.com/documentation/api/spreadsheet/#dialogbeforeopen


KB Link: https://www.syncfusion.com/kb/13581/how-to-customize-edit-alert-dialog-content-in-javascript-spreadsheet


Loader.
Up arrow icon