PDA

View Full Version : [FIXED] [4.0.2] grid columns sortable when sortableColumns : false



christophe.geiser
28 Jun 2011, 6:51 AM
Hi,
According to the docs (grid.Panel):

sortableColumns:
False to disable column sorting via clicking the header and via the Sorting menu items. Defaults to true.

However in the test case below, the column 'Price' is sorted when its header is clicked.
Cheers,
C.


// 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'],
['Exxon Mobil Corp', 68.1, -0.43, -0.64, '9/1 12:00am'],
['United Technologies Corporation', 63.26, 0.55, 0.88, '9/1 12:00am'],
['Verizon Communications', 35.57, 0.39, 1.11, '9/1 12:00am'],
['Wal-Mart Stores, Inc.', 45.45, 0.73, 1.63, '9/1 12:00am']
];


// create the Grid
var grid = Ext.create('Ext.grid.Panel', {
sortableColumns: false,
store: store,
stateful: true,
stateId: 'stateGrid',
columns: [
{
text : 'Company',
flex : 1,
sortable : false,
dataIndex: 'company'
},
{
text : 'Price',
width : 75,
sortable : true,
renderer : 'usMoney',
dataIndex: 'price'
},
{
text : 'Change',
width : 75,
dataIndex: 'change'
}, {
text : 'Last Updated',
width : 85,
sortable : false,
renderer : Ext.util.Format.dateRenderer('m/d/Y'),
dataIndex: 'lastChange'
}
],
height: 350,
width: 600,
title: 'Array Grid',
renderTo: Ext.getBody(),
viewConfig: {
stripeRows: true
}
});
win = new Ext.Window({layout: 'fit', items: grid}).show()

stevil
28 Jun 2011, 10:56 AM
I think this is definitely a bug - sortableColumns is passed from the grid config to the header config, and it's never referenced again, anywhere in (current) source.

Don't forget to fill out the bug report template!

stevil

christophe.geiser
20 Dec 2011, 12:25 AM
Bump
Still there in 4.0.7 and 4.1 prev.
C.

evant
20 Dec 2011, 3:42 PM
This is resolved for 4.1.

sblommers
10 Sep 2013, 3:45 AM
When setting 1 column to locked: true this bug reopens.

icube-dev
2 Oct 2014, 4:31 AM
sortableColumns (http://docs.sencha.com/extjs/5.0/apidocs/#!/api/Ext.panel.Table-cfg-sortableColumns): false, doesn't work in 5.0.1
(with no more configuration that the grid "model" in sencha architect)