This duplicates another bug already reported in our system: EXTJS-11993
  1. #1
    Ext JS Premium Member
    Join Date
    Dec 2009
    Posts
    65
    Vote Rating
    3
    oklymenko is on a distinguished road

      1  

    Default DataView scrolls to the top in IE when selecting an item

    DataView scrolls to the top in IE when selecting an item


    Ext version tested:
    • Ext 4.1.3
    • Ext 4.2.2
    Browser versions tested against:
    • IE9
    • IE11
    Description:
    • When selecting an item in a dava view using IE, the dataview always gets scrolled to the top
    Steps to reproduce the problem:The result that was expected:
    • the data view does not scroll
    The result that occurs instead:
    • the dataview scrolls to the top, I cannot see the item I just selected

  2. #2
    Sencha - Support Team
    Join Date
    Feb 2013
    Location
    California
    Posts
    4,082
    Vote Rating
    69
    Gary Schlosberg has a spectacular aura about Gary Schlosberg has a spectacular aura about Gary Schlosberg has a spectacular aura about

      0  

    Default


    Thanks for the report! I have opened a bug in our bug tracker.

  3. #3
    Sencha - Ext JS Dev Team
    Join Date
    Jun 2011
    Location
    Boston
    Posts
    82
    Vote Rating
    5
    germanicus is on a distinguished road

      2  

    Default


    This has already been fixed. Try this override:

    Code:
    Ext.define('EXTJSIV-11789.view.View', {
        override: 'Ext.view.View',
     
        focusNode: function(rec){
            var me          = this,
                node        = me.getNode(rec, true),
                el          = me.el,
                adjustmentY = 0,
                adjustmentX = 0,
                elRegion    = el.getRegion(),
                nodeRegion;
     
            // Viewable region must not include scrollbars, so use
            // DOM client dimensions
            elRegion.bottom = elRegion.top + el.dom.clientHeight;
            elRegion.right = elRegion.left + el.dom.clientWidth;
            if (node) {
                nodeRegion = Ext.fly(node).getRegion();
                // node is above
                if (nodeRegion.top < elRegion.top) {
                    adjustmentY =nodeRegion.top - elRegion.top;
                // node is below
                } else if (nodeRegion.bottom > elRegion.bottom) {
                    adjustmentY = nodeRegion.bottom - elRegion.bottom;
                }
     
                // node is left
                if (nodeRegion.left < elRegion.left) {
                    adjustmentX =nodeRegion.left - elRegion.left;
                // node is right
                } else if (nodeRegion.right > elRegion.right) {
                    adjustmentX = nodeRegion.right - elRegion.right;
                }
     
                if (adjustmentX || adjustmentY) {
                    me.scrollBy(adjustmentX, adjustmentY, false);
                }
     
                // Poke on a tabIndex to make the node focusable.
                Ext.fly(node).set({
                    tabIndex: -1
                });
     
                node.focus();
            }
        }
    });

  4. #4
    Ext JS Premium Member
    Join Date
    Dec 2009
    Posts
    65
    Vote Rating
    3
    oklymenko is on a distinguished road

      0  

    Default


    Thanks, the override worked great.