jQGrid : triple click needed to edit a cell

牧云@^-^@ 提交于 2019-12-25 07:33:36

问题


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 ?

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


回答1:


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
},

See https://jsfiddle.net/ft7zsocy/



来源:https://stackoverflow.com/questions/40676214/jqgrid-triple-click-needed-to-edit-a-cell

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!