jQuery 在jqGrid中,可以双击一行来调出编辑表单吗?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4982635/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-26 18:19:27  来源:igfitidea点击:

In jqGrid, can you double click a row to bring up the edit form?

jqueryjqgrid

提问by leora

In this demo of jqGrid, when you click on the "Edit Selected Row" button:

在 jqGrid 的这个演示中,当您单击“编辑选定行”按钮时:

enter image description here

在此处输入图片说明

it brings up an edit form.

它会弹出一个编辑表单。

enter image description here

在此处输入图片说明

Is there any way to double click on a row in the grid to bring up this same edit form?

有没有办法双击网格中的一行来调出相同的编辑表单?

回答by Oleg

It can be very simple implemented as

它可以非常简单地实现为

ondblClickRow: function(rowid) {
    jQuery(this).jqGrid('editGridRow', rowid);
}

you can also use any additional properties of editGridRowdescribed in the documentation. For example

您还可以使用文档中描述的editGridRow 的任何其他属性。例如

ondblClickRow: function(rowid) {
    jQuery(this).jqGrid('editGridRow', rowid,
                        {recreateForm:true,closeAfterEdit:true,
                         closeOnEscape:true,reloadAfterSubmit:false});
}

回答by Bashmakov Evgeniy

simple way

简单的方法

ondblClickRow : function(rowid) {
    $("#edit_mygridId").trigger("click");
}