Page 2 of 2
Re: Wiki - nuBeforeDelete - little typo
Posted: Wed Jun 08, 2022 10:18 am
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.
Re: Wiki - nuBeforeDelete - little typo
Posted: Wed Jun 08, 2022 10:37 am
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;}
}
Re: Wiki - nuBeforeDelete - little typo
Posted: Wed Jun 08, 2022 3:12 pm
by kev1n
Thanks for that! I will test it.
Re: Wiki - nuBeforeDelete - little typo
Posted: Thu Jun 09, 2022 5:41 am
by kev1n
The fix is now on Github.