more precise, I want a column with type uid, to be presented as strings using some transformation function (but only done once, during init)
That sounds like you want to manipulate the dataProvider, or wrap it and
cache the transformed value. I suppose your labelFunction could also cache
transformed values as well.
but I cant manipulate the dataProvider, because the new value is not the same type as in the dataProvider. Thats why I only want the dataGrid to show the manipulated column, not update the dataprovider
You can wrap the dataprovider objects, adding a string version of the
You can also encapsulate the labelFunction in the itemRenderer, but it will
still get called extra times when scrolling and other times the renderers
how do I do that?
How do you wrap an object? It depends on how you are getting your data. If
you are using RemoteObject or can control the data type being sent over the
wire, I would simply add a new getter to the data class.
The most rudimentary way is something like this: Say you had a ShoppingCart
public var catalogID:int;
A wrapper class might look like:
public function DisplayableShoppingCartRecord(orig:ShoppingCartRecord)
original = orig;
public var original:ShippingCartRecord;
public function get catalogID():int
private var _displayName:String;
public function get displayName():String
_displayName = yourOldLabelFunction(orig);
Then at some point, you loop through the original data set and instantiate
the wrapped versions and pass that dataprovider to the datagrid.