Prasad Tilloo
Prasad Tilloo

Reputation: 75

Need to display a Confirmation Box on "Submit" Click of JQGrid Edit Dialog Box

I am working on a Requirement to Display a Confirmation Box when a User Selects a Row to Edit and Clicks "Submit" button in the Dialog Opens up for EditGridRow.

Code:

jQuery(this).jqGrid('editGridRow', id,
                    {
                        editCaption: "Edit App Settings",
                        bSubmit: "Submit",
                        bCancel: "Cancel",
                        bClose: "Close",
                        saveData: "Data has been changed! Save changes?",
                        bYes : "Yes",
                        bNo : "No",
                        bExit : "Cancel",
                        recreateForm:true,
                        closeAfterEdit:true,
                        closeOnEscape:true,
                        reloadAfterSubmit:false
                        //onclickSubmit:ConfirmEdit()//function(){confirm('Are you sure you want to Edit the Record?');}
                     }                         
                );

Please suggest

Upvotes: 1

Views: 4454

Answers (1)

Justin Ethier
Justin Ethier

Reputation: 134167

There is already an option called checkOnSubmit that sounds like it does what you are looking for. From the jqGrid docs for Form Editing:

checkOnSubmit

This option work only in editing mode. If Set to true this option will work only when a submit button is clicked and if any data is changed in the form. If the data is changed a dilog message appear where the user is asked to confirm the changes or cancel it. Pressing cancel button of the new dialog will return to the form, but does not set the values to its original state.

Upvotes: 1

Related Questions