I need to send an extra parameter while I am trying to delete one or more rows in jQgrid. I have found the following:
- jqGrid additional POST data when deleting row
- jqGrid (Delete row) - How to send additional POST data?
But those are one/two year old answers and I think jQgrid has changed since then. I am using the formDeleting
option from jQgrid defined as follow:
formDeleting: {
url: '/ajax/forms/delete',
delicon: [true, "left", "fa-scissors"],
cancelicon: [true, "left", "fa-times"],
width: 320,
caption: 'Delete form',
msg: 'Are you sure you want to delete this form?',
beforeShowForm: function ($form) {
var rowids = $form.find("#DelData>td").data("rowids");
if (rowids.length > 1) {
$form.find("td.delmsg").html('Are you sure you want to delete all the selected forms?');
}
},
afterComplete: function (response, postdata, formid) {
if (response.responseText === "true") {
alert("The form was deleted successfully.", "Information");
} else {
alert("Something went wrong, the form could not be deleted.", "Error");
}
}
}
How do I add an extra parameter to the request so I can get it on the backend?