How do you disable editing of
the whole form?
Welcome to the nuBuilder Forums!
Register and log in to access exclusive forums and content available only to registered users.
Register and log in to access exclusive forums and content available only to registered users.
Disable Editing
Re: Disable Editing
atom,
https://wiki.nubuilder.cloud/ ... cess#Forms
Disable the Save Button when you set up Access Levels.
Steven
https://wiki.nubuilder.cloud/ ... cess#Forms
Disable the Save Button when you set up Access Levels.
Steven
-
- Posts: 785
- Joined: Sun Oct 14, 2018 11:25 am
Re: Disable Editing
Smart users can still call nuSaveAction() to save the record.admin wrote:atom,
https://wiki.nubuilder.cloud/ ... cess#Forms
Disable the Save Button when you set up Access Levels.
Steven
Until this is fixed, you can add this PHP code in the BS event:
Code: Select all
nuDisplayError('Saving is disabled');
-
- Posts: 12
- Joined: Mon Jan 22, 2018 9:08 am
Re: Disable Editing
Exactly, when you have "workflow" logic in your
application this wont work,
- you have a status field, initially set to "Draft"
- another user access level, set status field to "POSTED"
in this case you normally add action button only visible
to this access level,
- in this action button is a logic plus a call to nSaveAction()
** and thats where the problem is, a user can change
fields value, even without the Save button, the
added Action button will still save the changes
made.
I have found the solution, to disable all inputs by
$('#nuRECORD :input').prop('disabled','true');
What is missing is to detect if the form has changed,
which is available on nuBuilderPro.
application this wont work,
- you have a status field, initially set to "Draft"
- another user access level, set status field to "POSTED"
in this case you normally add action button only visible
to this access level,
- in this action button is a logic plus a call to nSaveAction()
** and thats where the problem is, a user can change
fields value, even without the Save button, the
added Action button will still save the changes
made.
I have found the solution, to disable all inputs by
$('#nuRECORD :input').prop('disabled','true');
What is missing is to detect if the form has changed,
which is available on nuBuilderPro.
-
- Posts: 785
- Joined: Sun Oct 14, 2018 11:25 am
Re: Disable Editing
How did you detect that in nuBuilderPro?atom wrote: What is missing is to detect if the form has changed,
which is available on nuBuilderPro.
Re: Disable Editing
atom,
I have disabled nuSaveAction() and nuDeleteAction() for cases where save and delete are not allowed.
The change is now on Github.
Let me know if it works for you.
Steven
I have disabled nuSaveAction() and nuDeleteAction() for cases where save and delete are not allowed.
The change is now on Github.
Let me know if it works for you.
Steven
-
- Posts: 785
- Joined: Sun Oct 14, 2018 11:25 am