views:

1045

answers:

1

Hello,

I have a DataGrid, with itemEditor as NumericStepper in a few columns. When a value in the DataGrid is edited, I would like to update several values displayed on the screen, and so want to call a updateValues() function.

First, I added this function to itemEditEnd event of the DataGrid, but the function is getting called before the new value is updated into the dataProvider and hence, the values I have in the function are the old values. Is there any other event that is fired after the values are updated into the dataProvider? or am I missing something?

Second, I tried putting this function in the change event of each itemEditor (duh!), but then again, the change event is fired, but the values in the dataProvider are the old ones.

Is there any way I can make the function updateValues() be called, every time a value is edited AND updated into the dataProvider, because there's where I am taking the values from.

Thanks a lot.

+1  A: 

"In your event listener, you can examine the data entered into the item editor. If the data is incorrect, you can call the preventDefault() method to stop Flex from passing the new data back to the list-based control and from closing the editor." (source)

So yeah, it gets called before the dataprovider has the data.

Here's what you should read: Detecting Datagrid Edits. He talks about all the same stuff. Event priority is the ticket. Overly complicated is the Flex way. Cheers.

Glenn
Thanks Glenn, I'll check the link and get back :)
Shrikant Sharat
how can I do the "you can examine the data entered into the item editor" part.. may be I can get the value I want in that way?
Shrikant Sharat
In the "Accessing cell data and the item editor in an event listener" section of my first link, look at the "getCellInfo" function.
Glenn
Glenn, I love you! That is exactly what I needed, though it took some time, I am finally finished with the datagrid.THANKS a lot!
Shrikant Sharat