Results 1 to 2 of 2

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

    Looks like we can't reproduce the issue or there's a problem in the test case provided.
  1. #1
    Sencha Premium Member
    Join Date
    Jul 2009
    Posts
    138
    Vote Rating
    4
      0  

    Default 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 - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,556
    Vote Rating
    1272
      0  

    Default

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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •