PDA

View Full Version : Currency format EURO



willylord
21 Oct 2013, 10:46 AM
Hi, I'm going to use the Treegrid layer, and I need to formatting a column in Italian Currency (euro with , and 2 decimals).

Somebody help me?

Thanks

burnnat
21 Oct 2013, 12:27 PM
You should use a column renderer (http://docs.sencha.com/extjs/4.2.1/#!/api/Ext.grid.column.Column-cfg-renderer) with Ext.util.Format.currency (http://docs.sencha.com/extjs/4.2.1/#!/api/Ext.util.Format) to format the values. For example:



Ext.apply(
Ext.util.Format,
{
currencySign: '€',
thousandSeparator: '.',
decimalSeparator: ','
}
);

new Ext.tree.Panel({
store: myStore,
columns: [
{
xtype: 'treecolumn',
text: 'Item',
dataIndex: 'name'
},
{
text: 'Cost',
dataIndex: 'cost',
renderer: function(value) {
return Ext.util.Format.currency(value);
}
}
]
});