0
votes

I have an editable DataGrid in Flex, with data full of numbers. The columns have no special itemRenderer, but a labelFunction, which returns the number as-is if positive, but puts it in parentheses if it is negative, like so

27.3 => "27.3"
-27.3 => "(27.3)"

Now, these cells are editable. When I try to edit a cell with a positive number, nothing is wrong. But if I try to edit a negative number, it starts editing (27.3) instead of editing -27.3. Because of this, when the edit is done, the labelFunction is evaluated with the new value in parentheses(i.e., labelFunction is called with "(30.5)"), and converting it to a Number results in NaN.

So, I want to know if I can make the DataGrid edit the data in the dataProvider instead of the label that it shows.

I hope I am clear with the condition. Please ask if you need any clarification.

Thank you.

1

1 Answers

1
votes

Is this what you're after?

Example: Modifying data passed to or received from an item editor - From livedocs.adobe.com

(You may still have to scroll down once the page loads... The anchor doesn't seem to be working for me.)