on_delete client side event not working

Questionson_delete client side event not working
pedro couto asked 1 year ago

Good Morning,

i´m trying to use my owne “yes/no” form for deleting records, as i need to ask 2 times before deleting a row.

after long time trying to find some information about how to do this, i take a look to your sample custom_events to try to find some light.

for that, i changed in the sample an unmarked the client side events on_delete option and ondblclickrow .

and comment all server side events.

ondblclickrow is working fine, the alert “‘Simulating, double click on id” appears,

but for the on_delete option does not work. when it has to do the same job: alert(‘Simulando evento de borrado’), it just delete the record and thats all.

can you help me?

the code:

https://gist.githubusercontent.com/pcouto/411a3d73bae8807b6acb6124b84f792a/raw/1b035734b18a8899399783fba6f8ed902e6388bd/custom_events_test.php

thank you in advance.

2 Answers
Abu Ghufran Staff answered 1 year ago

Hello,

I understand your query and I’ll be updating you back after some research on it.

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
Abu Ghufran Staff answered 1 year ago

You can try following setting for set_options function. You can replace “confirm” JS function with your own implementation.

$opt["delete_options"]["beforeSubmit"] = "function(){ if (confirm('Are you sure you want to delete?')) {return [true,''];} }";

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
Your Answer

16 + 13 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?