PDA

View Full Version : [OPEN] extjs4:2.1(GA) grid cell click return incorrect colIndex if there is hidden column



jimmylu98
5 Aug 2013, 9:01 AM
To see the problem after load the program:

(1) Try to click any cell on 'pctChange' column, the colIndex is 1 (it should be 2).

(2) Try to show 'Price' column, then click any cell on 'pctChange' column, the colIndex is 2 now.

Just download 4.2.1GA, I have saw a few critical bugs (I will reported once I have test codes). Not sure when we can have stable extjs 4.x.x in order to release our product.





Ext.onReady(function() {

Ext.QuickTips.init();

// 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'],
['American Express Company', 52.55, 0.01, 0.02, '9/1 12:00am'],
['American International Group, Inc.', 64.13, 0.31, 0.49, '9/1 12:00am'],
['Wal-Mart Stores, Inc.', 45.45, 0.73, 1.63, '9/1 12:00am']
];

// create the data store
var store = Ext.create('Ext.data.ArrayStore', {
fields: [
{name: 'company'},
{name: 'price', type: 'float'},
{name: 'change', type: 'float'},
{name: 'pctChange', type: 'float'},
{name: 'lastChange', type: 'date', dateFormat: 'n/j h:ia'}
],
data: myData
});

// create the Grid
var grid = Ext.create('Ext.grid.Panel', {
layout: 'fit',
store: store,
columns: [
{
text : 'Company',
flex: 4,
sortable : false,
dataIndex: 'company'
},
{
text : 'Price',
flex: 2,
sortable : true,
hidden: true,
dataIndex: 'price'
},
{
text : 'pctChange',
flex: 2,
sortable : true,
dataIndex: 'pctChange'
},
{
text : 'Change',
flex: 2,
sortable : true,
dataIndex: 'change'
}
],
columnLines: true,
height: 350,
width: 600,
title: 'Array Grid',
renderTo: Ext.getBody(),
listeners: {
cellDblClick: {
fn: function(view, td, cellIndex, record, tr, rowIndex, e){
console.info( ' colIndex = ' + cellIndex );
}
}
}
});

});

Gary Schlosberg
5 Aug 2013, 7:29 PM
Thanks for the report! I have opened a bug in our bug tracker.

JaceyB
21 May 2014, 5:53 AM
I know this is an old post, but did you find a solution around this? Just found this one myself recently and could do with a fix! :)

mcouillard
23 Apr 2015, 12:57 PM
Confirmed bug in 4.2.2
I then applied the 4.2.3 version of the feature and it solved it. No side effects yet, but we're still testing.

http://docs.sencha.com/extjs/4.2.3/source/Grouping.html#Ext-grid-feature-Grouping

I merely added the above to our application so it'd get used after Ext's own. There were many changes between the above file and 4.2.2's version.