Hi Mike,
you have to derive your own formatting class from
qx.ui.table.DefaultDataCellRenderer and overwrite the the _formatValue
method:
qx.OO.defineClass("qx.my.ui.table.MyNumberDataCellRenderer",
qx.ui.table.DefaultDataCellRenderer,
function() {
qx.ui.table.DefaultDataCellRenderer.call(this);
});
/**
* Formats a value.
*
* @param cellInfo {Map} A map containing the information about the cell to
* create. This map has the same structure as in
* [EMAIL PROTECTED] DataCellRenderer#createDataCell}.
* @return {string} the formatted value.
*/
qx.Proto._formatValue = function(cellInfo) {
var value = cellInfo.value;
if (value == null) {
return "";
} else if (typeof value == "number") {
return number.toString();
} else {
return value;
}
}
Then you have to set the cell renderer to you column in the table model:
var columnNumber = 1;
tableModel.setDataCellRenderer(columnNumber , new
qx.my.ui.table.MyNumberDataCellRenderer());
Or you can globaly disable the formatting with thousands separators by
doing the following after qooxdoo class hierarchie has loaded:
qx.util.format.NumberFormat.GROUPING_SEPARATOR = "";
lycovian schrieb:
> I have a Table object with some numeric columns. I am storing integers in
> the columns. The cell renderer seems to be formatting the cells though as
> #,### (with commas). Is there any way to turn this off. In one case the
> column is the primary key (numberic) and it doesn't make any sense to format
> it with a thousands seperator.
>
> Mike
>
--
Mit freundlichen Grüßen
Dietrich Streifert
Visionet GmbH
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel