Jul 07, 2011, 9:21 PM
[CLOSED] Toggle Render? Refresh Render?
Hi
I have a grid, with float values... 12300000.00.
The default rendered for the grid changes this to $1,230,000.00.
--Great--
Now, I want to change the render to output $1.23M
How can I, client-side...loop through the store/grid and/or "refresh" the rendered.
My rendered handles both types bases on a hidden parameter.
I have a button the changes that hidden param, then i want to "refresh" the grid/store..
I've tried changing the store value (ie setting it back to the same value, marking the record dirty) but since the
underlying float value does change, I don't think the render is firing?
I have a grid, with float values... 12300000.00.
The default rendered for the grid changes this to $1,230,000.00.
--Great--
Now, I want to change the render to output $1.23M
How can I, client-side...loop through the store/grid and/or "refresh" the rendered.
My rendered handles both types bases on a hidden parameter.
I have a button the changes that hidden param, then i want to "refresh" the grid/store..
I've tried changing the store value (ie setting it back to the same value, marking the record dirty) but since the
underlying float value does change, I don't think the render is firing?
function Money(v) {
try {
if (hidPercentDollar.getValue() == '$')
return Ext.util.Format.number(v, '$000,000,000,000.00');
var val = parseFloat(v);
if (val > 1000000 && val < 1000000000) {
//million
return '$' + parseFloat(val / 1000000).toFixed(2).toString() + 'M';
}
else if (val > 1000000000 && val < 1000000000000) {
//billion
return '$' + parseFloat(val / 1000000000).toFixed(2).toString() + 'B';
}
else if (val > 1000000000000) {
//trillion
return '$' + parseFloat(val / 1000000000000).toFixed(2).toString() + 'T';
}
else
return Ext.util.Format.number(v, '$000,000,000,000.00');
}
catch (e) {
alert("Money" + e.message);
}
}
Last edited by Daniil; Jul 08, 2011 at 3:41 PM.
Reason: [CLOSED]