PDA

View Full Version : Reconfigure grid - xtype:'numbercolumn' doesn't work



marxan
15 Apr 2014, 12:39 AM
Hello,

I'm doing a reconfigure of my grid by doing this:



var __columns = [];
for (i=0;i<numberOfYear;i++){
currentYear = parseInt(startingYear) + i;

idCol = 'columnTraps_'+ currentYear;

var item = Ext.create ('Ext.grid.column.Column', {
dataIndex: currentYear,
text: currentYear,
id : idCol,
width: 65,
xtype: 'numbercolumn',
format:'0.00'
});

__columns.push (item);

}
grid.reconfigure(store,__columns);


It's properly done except the format of my number where 'xtype:"numbercolumn" doesn't seem to work.

Anyone has already had this issue?

Thanks in advance,

Marxan

brian428
15 Apr 2014, 6:31 AM
It's properly done except the format of my number where 'xtype:"numbercolumn" doesn't seem to work.

No, it's not properly done.

First, with Ext.create(), you're specifying a class name. So xtype is irrelevant. Second, Ext.grid.column.Column is not Ext.grid.column.Number. If you want a number column, use the latter.

marxan
15 Apr 2014, 7:00 AM
thanks for your answer.