在IE7中,第一次点击网格会导致ExtJS Ext.grid.GridPanel跳转到页面顶部

In IE7 the first click on a grid causes an ExtJS Ext.grid.GridPanel to jump to the top of the page

本文关键字:GridPanel grid Ext 顶部 ExtJS 第一次 IE7 网格      更新时间:2023-09-26

我对输入的 ExtJS gridPanel 的数组有一个奇怪的问题 - 仅在 IE7 中,在触发 rowclick 事件之前,当我单击一行时,页面会向上滚动 2-3 行。重复单击时,页面会向上滚动,直到页面位于页面顶部。然后只有行单击传递到我的处理程序。我在这个网格上只注册了两个侦听器:

       侦听器:{            rowclick:function(grid, rowIndex, e) {             ...我的处理程序            },            sortchange : function(grid, rowIndex, e){}

你有什么想法吗?

我在Internet Explorer 7中遇到了类似的错误。对我来说缩放:1;职位:相对;在周围的容器上帮助强制布局属性。

试试这个补丁

Ext.override(Ext.selection.RowModel, {
    onRowMouseDown: function(view, record, item, index, e) {
        //IE fix: set focus to the first DIV in selected row
        Ext.get(item).down('div').focus();
        if (!this.allowRightMouseSelection(e)) {
            return;
        }
        this.selectWithEvent(record, e);
    }
});

实际上,可以使用任何"可聚焦"元素(tr和td不是)。