Simple question: How can one close ajqgrid edit form? I close dialog boxes with the following:
$("#submitDialog").dialog("close");
However, after inspecting the jqgrid form I’m having troubles finding the id to close. Here is the editGridRow call that I use to create the form (this is for adding a row, but the same applies to editing a row).
jQuery("#myGrid").editGridRow( "new",
{
url:'addRow?type=' + gridForm.famousType,
recreateForm:true,
afterSubmit: function(responseData)
{
openDialog("#errorDialog", responseData.responseText);
return [true, "true", 1];
},
errorTextFormat: function(serverresponse)
{
return serverresponse.responseText;
},
beforeSubmit: function(postdata, formid)
{
if(validationFunction == null)
{
return [true, ""];
}
return validationFunction.validate(postdata, formid);
},
beforeShowForm: (gridForm.beforeShowFormAdd)?gridForm.beforeShowFormAdd.run:null //false or null?
});
return false;
My guess is this is easy, I just haven’t seen anything that says how to do it, including on the jqgrid wiki. Ideas?
It may not be the answer you’re looking for, but since I couldn’t find it myself I ended up using this workaround:
Which will click the X button of the dialog, closing it.