I have a backend RPG program that returns records and one of the fields is a dollar value field. So I have a renderer on the grid field in order to show it as usMoney:
return Ext.util.Format.usMoney(value);
This works great.
However, if the user clicks a checkbox to indicate they only want to see those customers who have more than one record, I only return some basic data like account #, name, and the number of records for that customer... NOT the dollar value field (because it doesn't make sense in this grouped record). In this case, the dollar value field on the grid displays $0.00 and I'd like to suppress that.
So I tried editing my renderer to suppress the value if it is zero, and otherwise return the usMoney:
xtype: 'gridcolumn',
renderer: function(value, metaData, record, rowIndex, colIndex, store, view) {
if(value === 0) return "";
else
return Ext.util.Format.usMoney(value);
},
I don't get an error from what I can tell, but I still see $0.00.
Any ideas? Thanks.
return Ext.util.Format.usMoney(value);
This works great.
However, if the user clicks a checkbox to indicate they only want to see those customers who have more than one record, I only return some basic data like account #, name, and the number of records for that customer... NOT the dollar value field (because it doesn't make sense in this grouped record). In this case, the dollar value field on the grid displays $0.00 and I'd like to suppress that.
So I tried editing my renderer to suppress the value if it is zero, and otherwise return the usMoney:
xtype: 'gridcolumn',
renderer: function(value, metaData, record, rowIndex, colIndex, store, view) {
if(value === 0) return "";
else
return Ext.util.Format.usMoney(value);
},
I don't get an error from what I can tell, but I still see $0.00.
Any ideas? Thanks.
Comment