Updatable condition #5406
-
How to customize Updatable attribute? For example I want to Updatable(false) overall property/field if Status==Approved Many thanks, |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
You can do it in the dialog.ts or editordialog.ts files You can check for the status and then make it readonly. You can do this in the constructor or afterLoadEntity() Serenity.EditorUtils.setReadonly(this.element.find('.editor'), true); and also something like below to hide or disable buttons. this.deleteButton.hide(); I would also check before save in validateBeforeSave() and check it there. If it's super sensitive that they don't change, then you probably have to mess with the endpoint or repository files. If someone else does it differently or better, please chime in. |
Beta Was this translation helpful? Give feedback.
-
There is a sample |
Beta Was this translation helpful? Give feedback.
You can do it in the dialog.ts or editordialog.ts files
You can check for the status and then make it readonly. You can do this in the constructor or afterLoadEntity()
Serenity.EditorUtils.setReadonly(this.element.find('.editor'), true);
and also something like below to hide or disable buttons.
this.deleteButton.hide();
this.applyChangesButton.toggleClass('disabled', true);
I would also check before save in validateBeforeSave() and check it there. If it's super sensitive that they don't change, then you probably have to mess with the endpoint or repository files.
If someone else does it differently or better, please chime in.