jQGrid:需要单击三次以编辑单元格 [英] jQGrid : triple click needed to edit a cell

查看:76
本文介绍了jQGrid:需要单击三次以编辑单元格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在JQgrid中:要编辑一个单元格(不在第一列中),我需要单击3鼠标来聚焦一个单元格,我可以双击吗?

In JQgrid : To Edit a cell (not in first column), I need 3 mouse click to focus a cell, can I do that in double click ?

例如:如果要编辑网格中的描述"列,则需要单击3次.

Eg : If I want to edit 'desription' column in my grid I need 3 mouse click.

推荐答案

如果使用免费的jqGrid,则可以使用editRowfocusField选项:

If you use free jqGrid, then you can use You can use focusField option of editRow:

ondblClickRow: function (rowid, iRow, iCol, e) {
    $(this).jqGrid("editRow", rowid, { focusField: e.target });
},
beforeSelectRow: function (rowid) {
    var $self = $(this), i,
        // savedRows array is not empty if some row is in inline editing mode
        savedRows = $self.jqGrid("getGridParam", "savedRow");
    for (i = 0; i < savedRows.length; i++) {
        if (savedRows[0].id !== rowid) {
            // save currently editing row
            // one can replace saveRow to restoreRow in the next line
            $self.jqGrid("saveRow", savedRows[i].id);
        }
    }
    return savedRows.length === 0; // allow selection if saving successful
},

请参见 https://jsfiddle.net/ft7zsocy/

这篇关于jQGrid:需要单击三次以编辑单元格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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