styled Confirmation msg in add an edit dialog

Questionsstyled Confirmation msg in add an edit dialog
andyvill asked 7 months ago

dear Abu.

 

in this moment, i use as confirmation msg in add or edit form this code:

 

$opt[“add_options”][“beforeSubmit”] = “function(){ if (confirm(‘Seguro que desea guardar los datos?’)==true) return [true,”]; else return [false,’No se han guardado los datos:<br>El usuario cancelo la acccion’]; }”;

$opt[“edit_options”][“beforeSubmit”] = “function(){ if (confirm(‘Seguro que desea guardar los datos?’)==true) return [true,”]; else return [false,’No se han guardado los datos:<br>El usuario cancelo la acccion’]; }”;

$opt[“beforeSaveRow”] = “function(){ if (confirm(‘Seguro que desea guardar los datos?’)==true) return [true,”]; else return [false,’Se ha cancelado el guardadoNo se han guardado los datos:<br>El usuario cancelo la acccion’]; }”;

 

exist a way to insert a styled confirmation msg has the deletion confirmation to add or edit operations??

 

sorry for my bad english.

thanks!

 

 

6 Answers
andyvill answered 7 months ago

i try to generate a styled confirmation msg with:

 

$grid[“edit_options”] = array(‘caption’=>’My Caption’,’msg’=>’Do Stuff ?’,’bSubmit’=>’Yes’,’bCancel’=>’Cancel’);

$grid[“add_options”] = array(‘caption’=>’My Caption’,’msg’=>’Do Stuff ?’,’bSubmit’=>’Yes’,’bCancel’=>’Cancel’);

 

butt not working

 

thnks!

Abu Ghufran Staff answered 7 months ago

Thanks for the update.

To open styled confirmation dialog box, demo is in package:

https://www.phpgrid.org/demo/demos/editing/dialog-layout.php (click on button: Custom Dialog)

Code: https://www.phpgrid.org/demo/demos/editing/dialog-layout.php

_________________________
Abu Ghufran - Dev Team
PHP Grid Framework
 
andyvill answered 7 months ago

dear Abu

I have a unique problem with this code, I can not make the message respond from the form, the form confirmation function immediately delivers the negative value. (when opening the window) I need the window to correctly evaluate the response.

please run the code and view the problem.

please i need your help thanks

 

 

Abu Ghufran Staff answered 7 months ago

Hi Andyvill,

I tested your code and understand your issue now. I’ll be updating you back after some working.

_________________________
Abu Ghufran - Dev Team
PHP Grid Framework
 
Abu answered 2 months ago

Hello,

Instead of manually making dialog box, there is a built in feature that confirm saving changes.

To enable it you need to set:

$opt[“edit_options”][“checkOnSubmit”] = true;

$g->set_options($opt);

Update JS files might be required and you can get it from this link.

https://www.phpgrid.org/demo/lib/js/jqgrid/js/jquery.jqGrid.min.js

Demo: https://www.phpgrid.org/demo/demos/editing/dialog-layout.php > select row > edit from toolbar > submit

Hope it helps.

Your Answer

16 + 5 =

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 / 5. Vote count:

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

Let us improve this post!