This content has been marked as final. Show 4 replies
You no longer need editField. Just change the item in your dataProvider and call itemUpdated and pass the item:
var item:MyObject = dp.getItemAt( someIndex ) as MyObject;
item.city = "San Francisco";
The headerRenderer has changed and it does refresh more frequently. We are looking into that.
The set data function is called more frequently, that's true. There are different phases in the Flex framework which update it. You have to check for null values as well.
Thanks for your continuous help.
Actually, i met some migration issuses about the headerRenderer.
Now I have a datagird, one of whose columns is rendered using a CheckBox control. And i also renderer its header to provide some convenience. Actually, i put a CheckBox on the header, it is for "Select All" use.
As the SetValue function of renderer file in Flex 1.5 seems to be called only once, I do not do any additional job. But I find it can not work in Flex 2.0. I click the "Select All" checkbox on the header, it is refreshed to be unselected state again. I know this is because Set Data function is called many times. So I try to use a variable to save the selection state, and reset the CheckBox in the Set Data function. At first, i declare it as a private variable in the renderer file, it fails to work. Finally, i find a ugly way to solve the problem. I declare it in the main file (I mean the mxml file that contains <mx:Application>), and in the renderer file, I import mx.core.Application package, and use Application.application.variable to reference it , and it really works.
I wonder if it is a recommended way or there should be a better solution.
Continue to use the method you discovered. The headerRenderer is not being refreshed - it is being recreated. I am not sure why at this point, but I am investigating.
Thanks for your advice.