Skip to content

Updatable condition #5406

Answered by erehtolleh
harifenny asked this question in Help
Jan 28, 2021 · 2 comments · 2 replies
Discussion options

You must be logged in to vote

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.

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@edwardch
Comment options

Answer selected by harifenny
Comment options

You must be logged in to vote
1 reply
@harifenny
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
3 participants