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!
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!
code of last try https://gist.github.com/andyvillchile/339c14358bc1d03d66d3bf5f8620cd95
image of last try https://imgur.com/a/qOnaLuM thanks!
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
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
Hi Andyvill,
I tested your code and understand your issue now. I’ll be updating you back after some working.
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.