如何禁用Prime Faces数据表bindSelectionKeyEvents

时间:2017-11-16 11:11:09

标签: javascript jquery primefaces

enter image description here我正在尝试使用行扩展编辑数据表行,但<p:input>不接受IE 11中的任何spacenew line。其他浏览器正在工作精细。它唯一的IE11。在JS调试之后,我发现当输入内容输入时,它会转到

 bindSelectionKeyEvents: function () {
    var a = this;
    this.getFocusableTbody().on("focus", function (b) {
        if (!a.mousedownOnRow) {
            a.focusedRow = a.tbody.children("tr.ui-widget-content.ui-datatable-selectable.ui-state-highlight").eq(0);
            if (a.focusedRow.length == 0) {
                a.focusedRow = a.tbody.children("tr.ui-widget-content.ui-datatable-selectable").eq(0)
            }
            a.highlightFocusedRow();
            if (a.cfg.scrollable) {
                PrimeFaces.scrollInView(a.scrollBody, a.focusedRow)
            }
        }
    }).on("blur", function () {
        if (a.focusedRow) {
            a.unhighlightFocusedRow();
            a.focusedRow = null
        }
    }).on("keydown", function (f) {
        var d = $.ui.keyCode
                , b = f.which;
        if ($(f.target).is(":input") && a.cfg.editable) {
            return
        }
        if (a.focusedRow) {
            switch (b) {
                case d.UP:
                    var g = a.focusedRow.prev("tr.ui-widget-content.ui-datatable-selectable");
                    if (g.length) {
                        a.unhighlightFocusedRow();
                        a.focusedRow = g;
                        a.highlightFocusedRow();
                        if (a.cfg.scrollable) {
                            PrimeFaces.scrollInView(a.scrollBody, a.focusedRow)
                        }
                    }
                    f.preventDefault();
                    break;
                case d.DOWN:
                    var c = a.focusedRow.next("tr.ui-widget-content.ui-datatable-selectable");
                    if (c.length) {
                        a.unhighlightFocusedRow();
                        a.focusedRow = c;
                        a.highlightFocusedRow();
                        if (a.cfg.scrollable) {
                            PrimeFaces.scrollInView(a.scrollBody, a.focusedRow)
                        }
                    }
                    f.preventDefault();
                    break;
                case d.ENTER:
                case d.NUMPAD_ENTER:
                case d.SPACE:
                    f.target = a.focusedRow.children().eq(0).get(0);
                    a.onRowClick(f, a.focusedRow.get(0));
                    f.preventDefault();
                    break;
                default:
                    break
            }
        }
    })
}

我的项目不需要任何键盘快捷键。所以作为一个简单的解决方案,我想禁用它。

我尝试过:

          $(document).ready(function () {      
                        PF('tablePartner').bindSelectionKeyEvents = null;
                      });

0 个答案:

没有答案