Welcome to the nuBuilder Forums!

Join our community by registering and logging in.
As a member, you'll get access to exclusive forums, resources, and content available only to registered users.

nuBeforeDelete() event? Topic is solved

Questions related to using nuBuilder Forte.
Post Reply
toms
Posts: 785
Joined: Sun Oct 14, 2018 11:25 am

nuBeforeDelete() event?

Unread post by toms »

Hi,

There's an event nuBeforeSave() that allows you to cancel a save action.
What about a nuBeforeDelete() event? This would be useful if you want to allow/disallow the deletion of certain records.
E.g. to allow a user to delete only his own records or some records that meet certain criterias etc.

Code: Select all

function nuBeforeDelete() {
 if (nuUserName() != $('#cus_name').val()) {
   nuMessage(['You can only delete your own records']);
   return false;
 }
  return true;
}
admin
Site Admin
Posts: 2829
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 30 times

Re: nuBeforeDelete() event?

Unread post by admin »

toms,

Good idea.

I have added that now on Github.

Steven
toms
Posts: 785
Joined: Sun Oct 14, 2018 11:25 am

Re: nuBeforeDelete() event?

Unread post by toms »

Thanks!
admin
Site Admin
Posts: 2829
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 30 times

Re: nuBeforeDelete() event?

Unread post by admin »

.
Post Reply