如何在 jqGrid 上编辑选定的单元格 [英] How to edit the selected cell on jqGrid

查看:29
本文介绍了如何在 jqGrid 上编辑选定的单元格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 jqGrid 进行内联编辑,但是当我选择一个单元格时,光标设置在该行的第一列,但我想知道是否有任何方法可以编辑我拥有的当前单元格点击,而不是第一行.

I'm using inline editing with jqGrid, but when I select a cell, the cursor is set in the first column of the row, but I'd like to know if there is any way to edit the current cell I have clicked on, instead of the first row.

提前致谢.

推荐答案

非常好!

我个人更喜欢使用 ondblClickRow 事件处理程序来启动编辑模式.所以你可以使用 oneditfunc 参数编辑行:

I personally prefer to use ondblClickRow event handler to start the editing mode. So you can use oneditfunc parameter of the editRow:

ondblClickRow: function(rowid,iRow,iCol,e) {
    grid.jqGrid('editRow',rowid,true,function(){
        $("input, select",e.target).focus();
    });
    return;
}

或者在editRow的调用之后放置类似设置焦点的代码:

or just place the like of code which set the focus after the call of editRow:

ondblClickRow: function(rowid,iRow,iCol,e) {
    grid.jqGrid('editRow',rowid,true);
    $("input, select",e.target).focus();
    return;
}

此处查看相应的演示.

这篇关于如何在 jqGrid 上编辑选定的单元格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆