PDA

View Full Version : [FIXED][3.3.0] Columnmodel. Column config "hidden" property not work



galdaka
14 Jul 2010, 10:26 PM
Ext version tested:

Ext 3.3.0 ONLY (3.1.1 does not have the bug)


Adapter used:

ext


css used:

All themes


Browser versions tested against:

Firefox
IE8
Chrome


Operating System:

Windows XP Proffesional.
Description & code:


cm = new Ext.grid.ColumnModel({
columns: [
sm,
{header: 'one', dataIndex: 'bajaEmpleado', align: 'center', renderer: function(data, p, record){return data == '0' ? '<b>En activo</b>' : '<b>Baja</b>'}, hidden: true},
{header: 'two', dataIndex: 'estado', align: 'left', renderer: function(data){return '<i>' + data + '</i>'}, hidden: true},
{header: 'three', dataIndex: 'nombreEmpleado', align: 'left'},
{header: 'four', dataIndex: 'apellidosEmpleado'},
{header: 'five', dataIndex: 'localizacionEmpleado'},
{header: 'six', dataIndex: 'clienteEmpleado'},
{header: 'seven', dataIndex: 'categoriaEmpleado'},
{header: 'eight', dataIndex: 'fecAltaEmpleado', align: 'center', dateRenderer: Ext.util.Format.dateRenderer('m/d/Y')}
],
defaultSortable: true








});Steps to reproduce the problem:

Create a gridPanel and in a columnmodel config put various columns with the property "hidden" to true (Same the above example).
The result that was expected:

Columns to be hidden on init grid.


The result that occurs instead:

The columns with property "hidden" are visible.

evant
14 Jul 2010, 11:46 PM
Can't reproduce this. Please post a test case:



Ext.onReady(function(){

new Ext.grid.GridPanel({
width: 400,
height: 400,
renderTo: document.body,
store: [[1, 2, 3], [4, 5, 6], [7, 8, 9]],
columns: [{
dataIndex: 'field1',
width: 100,
header: 'Col 1'
},{
dataIndex: 'field2',
hidden: true,
width: 100,
header: 'Col 2'
},{
dataIndex: 'field3',
width: 100,
header: 'Col 3'
}]
});

});

galdaka
15 Jul 2010, 3:27 AM
I attach bug example: http://www.jadacosta.es/contents/screencast/test02.zip (http://www.jadacosta.es/contents/screencast/test02.zip)

The columns are visible. And in configuration I put "hidden: true"

evant
15 Jul 2010, 3:33 AM
That's not really a serviceable test case, there's so much extra code there it makes it incredibly difficult to identify whether there's a problem with your code, or there's a genuine bug. Please post a minimal test case (similar to mine) that demonstrates the problem.

galdaka
15 Jul 2010, 10:43 AM
I modified the example for make more compresive.

Please click in http://www.jadacosta.es/contents/screencast/test02.zip

Greetings,

galdaka
19 Jul 2010, 3:55 AM
Sorry, my English is very bad. I donĀ“t undesrtand you. In the file is the example of problem.

The problem is that the first two columns should be hidden and are not.

Greetings,

Animal
19 Jul 2010, 4:12 AM
It's a weird spammer. I'll delete it.

evant
20 Sep 2010, 7:32 AM
Not able to reproduce this using the 3.3 beta. Marking as closed.

galdaka
20 Sep 2010, 10:55 AM
The problem exits in 3.3.0 final

thanks in advance.

galdaka
24 Nov 2010, 4:34 AM
No Close. The problem exits in 3.3.0 final

thanks in advance.

Please click in http://www.jadacosta.es/contents/screencast/test02.zip

Animal
24 Nov 2010, 4:20 PM
There is actually a bug in getColumnStyles...



getColumnStyle : function(colIndex, isHeader) {
var colModel = this.cm,
colConfig = colModel.config,
style = isHeader ? '' : colConfig[colIndex].css || '',
align = colConfig[colIndex].align;

style += String.format("width: {0};", this.getColumnWidth(colIndex));

if (colModel.isHidden(colIndex)) {
style += 'display: none'; // Needs a semicolon after the "none" otherwise the align collides
}

if (align) {
style += String.format("text-align: {0};", align);
}

return style;
},

WixSL
24 Nov 2010, 5:04 PM
galdaka:

The files "ext-all-debug.js" and "ext-base.js" in your example are not the same as the downloaded from sencha site.

Replacing your "ext-all-debug.js" and "ext-base.js" with the original ones, makes your example works correctly.

galdaka
24 Nov 2010, 11:36 PM
OK. Problem Solved!

Thanks.

meroy
4 Dec 2010, 2:16 AM
The semicolon is present in 3.3.1.