Welcome to the nuBuilder Forums!

Register and log in to access exclusive forums and content available only to registered users.

Wiki - nuBeforeDelete - little typo Topic is solved

Questions related to using nuBuilder Forte.
selector
Posts: 41
Joined: Tue Feb 22, 2022 1:55 pm
Has thanked: 9 times

Re: Wiki - nuBeforeDelete - little typo

Unread post by selector »

kev1n wrote: Wed Jun 08, 2022 10:16 am I can replicate. Try adding nuDieplayError('Deleting not allowed...'); in BD (Before Delete)
This prevents deletion. By the way, after calling nuDisplayError, hidden action buttons are displayed in the header

ok the problem is - nuDeleteAction in nuForm.JS

Code: Select all

function nuDeleteAction(){

	if (confirm(nuTranslate("Delete This Record?"))){
		$('#nuDelete').prop('checked', true);

		nuUpdateData('delete');

	}
}
and further in nuajax.js - function nuUpdateData

Code: Select all

last.deleteAll			= $('#nuDelete').is(":checked") ? 'Yes' : 'No';
Obviously, it is necessary to clear #nuDelete if the deletion is refused. This is easier and more reliable than doing a lot of conditions and checks.
selector
Posts: 41
Joined: Tue Feb 22, 2022 1:55 pm
Has thanked: 9 times

Re: Wiki - nuBeforeDelete - little typo

Unread post by selector »

nuajax.js - function nuUpdateData
It works for me.

Code: Select all

	if(action != 'save' && window.nuBeforeDelete){if(nuBeforeDelete() === false ){
	      $('#nuDelete').prop('checked', false);
	      return;}
	      }
kev1n
nuBuilder Team
Posts: 4297
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 444 times
Contact:

Re: Wiki - nuBeforeDelete - little typo

Unread post by kev1n »

Thanks for that! I will test it.
kev1n
nuBuilder Team
Posts: 4297
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 444 times
Contact:

Re: Wiki - nuBeforeDelete - little typo

Unread post by kev1n »

The fix is now on Github.
Post Reply