I am using a Custom Itemrenderer Component for my DataGRidColumn .
I am concerned about the performance of the Application .
This is my code and working fine with good performance , until i did some changes .
if(viewName == "PeopleBasedView")
Testing2.itemRenderer = new ClassFactory(navigation.ViewElement);
Testing2.itemRenderer = new ClassFactory(navigation.DomainElemnt);
Now as per the requirement , i have added state to an HBox (which included adding an Image to it dynamically to an HBox ).
But adding this resulted in slowing of the Application dramitically .
Please tell me whether i am creating too many instances of the itemRenderer component ?? will it effect in performance ??
public function ChageToNormalView():void
Testing2.itemRenderer = new ClassFactory(ViewElementOrdinary);
public function ChageToNormalView2():void
Testing2.itemRenderer = new ClassFactory(ViewElement);
<mx:Image id="three" source="@Embed(source='/table.PNG')" click="ChageToNormalView()"/>
<mx:Image id="three3" source="@Embed(source='/DataGrid.PNG')" click="ChageToNormalView2()"/>
Please sugest , thanks .
If you have a big amount of records in your DataGrid so for sure it will affect the application's performance.
Try always to use lightweight containers when working with itemRenderer. My suggestion is to use Canvas instead of HBox.
You can also check how the itemRenderers are affecting the performance by running your application with Profile in Flex/Flash Builder.
Hope it might help you!