user427969
user427969

Reputation: 3896

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

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.

Upvotes: 1

Views: 5685

Answers (2)

user427969
user427969

Reputation: 3896

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

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

Upvotes: 2

Rohland
Rohland

Reputation: 1427

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);
}

Upvotes: 1

Related Questions