JSFiddle - React, Tailwind, and code Playground
by mowglisanu
JavaScript
Ext.application({
name: 'Fiddle',
launch: function() {
Ext.create("Ext.Viewport", {
layout : "fit",
items : {
xtype : "gridpanel",
store : Ext.create("Ext.data.Store", {
fields : ["numberwithdots", "numberwithoutdots","currency","format"],
data : [{
numberwithdots : 1.02,
numberwithoutdots : 1.02,
currency: '€',
format: '0.00'
},{
numberwithdots : 109.51,
numberwithoutdots : 109.51,
currency: '$',
format: '0'
}]
}),
columns : [{
text : "currency",
flex : 1,
dataIndex : "currency"
},{
text : "format",
flex : 1,
dataIndex : "format"
},{
text : "Number with dots",
flex : 1,
dataIndex : "numberwithdots",
renderer: renderMoney
}, {
text : "Number without dots",
flex : 2,
dataIndex : "numberwithoutdots",
renderer: renderMoney
}]
}
});
}
});
function renderMoney(value,b,records){
return Ext.util.Format.number(value, records.data.currency + ' ' + records.data.format)
}