Grid scrolls to top when any row is clicked in ext js

大兔子大兔子 提交于 2019-12-11 12:53:25

问题


I am facing a very strange problem. I have a grid and when i CLICK on any row then grid automatically goes to first record, though the row on which i click is selected but not focused.

The problem is strange because when i used that same grid as an example then there was no problem and everything works fine.

I really dont understand what could cause this problem? i haven't overridden any listeners to scroll to top either.


回答1:


i had following in my code which was causing it so remove this:

Ext.override(Ext.grid.GridView, {
     syncFocusEl : Ext.emptyFn
});



回答2:


This doesn't work with ExtJs 4.0. I've got it working with the following. I haven't fully tested for unexpected side effects.

Ext.override(Ext.selection.RowModel, {
    onRowMouseDown: function (view, record, item, index, e) {
        this.selectWithEvent(record, e);
    }
});

The original method looks like this:

onRowMouseDown: function(view, record, item, index, e) {
    view.el.focus();
    this.selectWithEvent(record, e);
}


来源:https://stackoverflow.com/questions/3784014/grid-scrolls-to-top-when-any-row-is-clicked-in-ext-js

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