PDA

View Full Version : [CLOSED] FocusManager.enable causes grid column hide via header menu to change location.hash



JacobGu
7 Dec 2012, 4:40 AM
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:

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

mitchellsimoens
7 Dec 2012, 7:32 AM
Thanks for the report! I have opened a bug in our bug tracker.