Skip to content Skip to sidebar Skip to footer

Beforesubmit Event To Custom Button On A Custom Form Of Jqgrid Doesn't Work

I am using jqgrid 4.5.2 version with Jquery-3.2.1. In jqgrid, in place of edit buttons (add, edit and delete) custom (add, edit and delete) buttons are implemented. Now on clicking

Solution 1:

It seems you put this question second time. The documenatation for this is here

Basically in this case you will need to define that event and return the appropriate array. Using the help provided in the link when you click the custom button defined in a onclick event you can do this:

...
jQuery("#grid_id").jqGrid('editGridRow', rowid, {
    ...
    beforeSubmit : function( postdata, formid ) {
        if(someconditionOK) {
            return [true,''];
        } else {
            return [false,'Error submiting data'];
        }
    },
    ...
});

Solution 2:

If we want to use beforeSubmit event we must use build in form editing - in all other cases the event will not work - with simple words we need to write our own custom before submit in case of using our own editing form.

Post a Comment for "Beforesubmit Event To Custom Button On A Custom Form Of Jqgrid Doesn't Work"