Search code examples
gridextjs4

ExtJS 4, Issue in grid with selType: checkboxmodel, after first click scroll to top


I have a grid with selType: 'checkboxmodel' but in IE there is an issue: after clicking on grid row (selecting it) page scroll to position that first row is on top.

Please, help.


Solution

  • Found a proper anwser

            Ext.override(Ext.selection.CheckboxModel, {
                onRowMouseDown: function (view, record, item, index, e) {
                    //view.el.focus(); - commented focus()
                    var me = this,
                        checker = e.getTarget('.' + Ext.baseCSSPrefix + 'grid-row-checker'),
                        mode;
                    if (!me.allowRightMouseSelection(e)) {
                        return;
                    }
                    if (me.checkOnly && !checker) {
                        return;
                    }
                    if (checker) {
                        mode = me.getSelectionMode();
                        if (mode !== 'SINGLE') {
                            me.setSelectionMode('SIMPLE');
                        }
                        me.selectWithEvent(record, e);
                        me.setSelectionMode(mode);
                    } else {
                        me.selectWithEvent(record, e);
                    }
                }
            });
    

    worked for me