You found a bug! We've classified it as EXTJS-7946 . We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.
  1. #1
    Sencha Premium Member
    Join Date
    Jul 2009
    Posts
    116
    Vote Rating
    0
    JacobGu is on a distinguished road

      0  

    Default FocusManager.enable causes grid column hide via header menu to change location.hash

    FocusManager.enable causes grid column hide via header menu to change location.hash


    REQUIRED INFORMATION


    Ext version tested:
    • Ext 4.1.1
    Browser versions tested against:
    • Chrome 23 (OS X 10.8.2)
    • Safari 6.2
    • Firefox 16
    Description:
    • Ext.FocusManager - enabling it causes grid column hide via header menu to change location.hash
    Steps to reproduce the problem:
    • Enable FocusManger.
    • Create simple grid panel.
    • Go to a column header menu, and hide any column.
    The result that was expected:
    • Column simply hides with no other side effects.
    The result that occurs instead:
    • location.hash changes to '#'
    • It does not change hash if FocusManager is not enabled.
    Test Case:

    Code:
    Code:
    window.onhashchange = function () {
    console.log('hash changed to: ' + location.hash);            
    };
    
    Ext.define('Company', {
    extend: 'Ext.data.Model',
    fields: [
    {name: 'company'},
    {name: 'price',      type: 'float', convert: null,     defaultValue: undefined},
    {name: 'change',     type: 'float', convert: null,     defaultValue: undefined},
    {name: 'pctChange',  type: 'float', convert: null,     defaultValue: undefined},
    {name: 'lastChange', type: 'date',  dateFormat: 'n/j h:ia', defaultValue: undefined}
    ],
    idProperty: 'company'
    });
    
    Ext.onReady(function() {
    
    Ext.FocusManager.enable();
    
    // sample static data for the store
    var myData = [
    ['3m Co',                               71.72, 0.02,  0.03,  '9/1 12:00am'],
    ['Alcoa Inc',                           29.01, 0.42,  1.47,  '9/1 12:00am'],
    ['Altria Group Inc',                    83.81, 0.28,  0.34,  '9/1 12:00am']
    ];
    
    // create the data store
    var store = Ext.create('Ext.data.ArrayStore', {
    model: 'Company',
    data: myData
    });
    
    // create the Grid
    var grid = Ext.create('Ext.grid.Panel', {
    renderTo: Ext.getBody(),
    store: store,
    columns: [
    {
    text     : 'Company',
    flex     : 75,
    sortable : false,
    dataIndex: 'company'
    },
    {
    text     : 'Price',
    width    : 50,
    sortable : true,
    renderer : 'usMoney',
    dataIndex: 'price'
    },
    {
    text     : 'Change',
    width    : 50,
    sortable : true,
    dataIndex: 'change'
    }
    ],
    height: 200,
    width: 400,
    title: 'Array Grid'
    });
    });‚Äč

    HELPFUL INFORMATION

    See this URL for live test case: http://jsfiddle.net/jacobg/8X3qw/


    Debugging already done:
    • I tried overriding Ext.menu.Item onClick in order to stopEvent, but that doesn't work, because it looks like the browser click event is inaccessible because EventManager is wrapping the listener and replacing it with an EventObject focus event.
    Possible fix:
    • not provided
    Additional CSS used:
    • only default ext-all.css
    Operating System:
    • Mac OS X

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,330
    Vote Rating
    847
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


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

Thread Participants: 1