JQGrid表单编辑关闭表单

时间:2012-02-24 19:13:26

标签: jqgrid

简单的问题:如何关闭ajqgrid编辑表单?我用以下内容关闭对话框:

    $("#submitDialog").dialog("close");

然而,在检查jqgrid表单后,我很难找到要关闭的id。这是我用来创建表单的editGridRow调用(这是用于添加行,但这同样适用于编辑行)。

    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;

我猜这很容易,我只是没有看到任何说明如何做的事情,包括在jqgrid wiki上。想法?

1 个答案:

答案 0 :(得分:4)

这可能不是您正在寻找的答案,但由于我自己无法找到它,我最终使用此解决方法:

jQuery('.ui-jqdialog-titlebar-close').click();

单击对话框的X按钮,关闭它。

相关问题