jqgrid - double clicking a row selects the row in

2019-02-20 14:27发布

When I double click a row it is selecting the row in IE8 but not in FF and Chrome. Is it an issue in IE8 or is there any bug for this? Thanks...

标签: jquery jqgrid
1条回答
Explosion°爆炸
2楼-- · 2019-02-20 14:41

The behavior is well-know. For example you can read the following in the documentation of the jQuery.dblclick:

The sequence of events triggered varies from browser to browser, with some receiving two click events before the dblclick and others only one. Double-click sensitivity (maximum time between clicks that is detected as a double click) can vary by operating system and browser, and is often user-configurable.

If you want common behavior in all browsers you code do the following:

ondblClickRow: function (rowid) {
    if ($.browser.msie && parseInt($.browser.version, 10) < 9) {
        $(this).jqGrid('setSelection', rowid, false);
    }
}

see the demo or the opposite behavior with the code

ondblClickRow: function (rowid) {
    if (!$.browser.msie || parseInt($.browser.version, 10) > 8) {
        $(this).jqGrid('setSelection', rowid, false);
    }
}

see another demo.

查看更多
登录 后发表回答