[英]how can i use two renderers in extjs4 javascript?
I have a field which is numeric and it should be currency is '$' and it has '0.000,00' struct. 我有一个数字字段,应为currency为“ $”,结构为“ 0.000,00”。 for currency and number struct'0.000,00' I have to use renderer for both of them.
对于货币和数字结构'0.000,00',我必须同时使用渲染器。 However, two renderers does not work in right way.
但是,两个渲染器无法正确工作。 The last renderer written works.
最后的渲染器写的作品。 how can I solve this problem?
我怎么解决这个问题?
{
header: dil('Fiyat'),
width: 30,
sortable: true,
currencySymbol: '$',
renderer: Ext.util.Format.usMoney,
renderer: Ext.util.Format.numberRenderer('0.000,00/i'),
dataIndex: 'fiyat'
}
solution: 解:
renderer: Ext.util.Format.numberRenderer('$0.000,00/i'). it works both currency and format .
Use a renderer function: 使用渲染器功能:
{
header: dil('Fiyat'),
width: 30,
sortable: true,
renderer: function(value, metaData, record, rowIndex, colIndex, store) {
return value; //You can render your value here however you like.
},
dataIndex: 'fiyat'
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.