3

I have a strange issue with an Array fed ExtJS gridPanel - in IE7 only, before the rowclick event is fired, when I click on a row, the page scrolls up 2-3 rows. On repeated clicks, the page scrolls up until the page is at the top of the page. Then only the rowclicks are passed through to my handler. I only have two listeners registered on this grid:

 
        listeners: {
            rowclick:function(grid, rowIndex, e) {
             ... my handler
            },
            sortchange : function(grid, rowIndex, e){}

Do you have any ideas?

Awais Qarni
  • 17,492
  • 24
  • 75
  • 137
Gerhard
  • 41
  • 1
  • 3
  • possible duplicate of [How to prevent extjs grid from scrolling when clicking on a cell?](http://stackoverflow.com/questions/6061392/how-to-prevent-extjs-grid-from-scrolling-when-clicking-on-a-cell) – Bo Persson Mar 19 '12 at 18:44

2 Answers2

3

I experienced similar bug in Internet Explorer 7. For me zoom:1; position:relative; on surrounding container helped to force layout property.

Raj
  • 31
  • 1
  • Thank you! I was having the same problem as OP, but in Internet Explorer 8. Using your CSS on the parent container solved the problem, but only when I also switched my code to use the `select` event of the grid; I had been using the `itemclick` event before, which still had the same bad behavior even with the CSS. This is with ExtJS 4.0.7, by the way. – Jeff Evans Jan 23 '12 at 16:26
2

Try out this patch

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

Actually, any 'focusable' element can be used (tr and td are not).