Skip navigation
l33tian
Currently Being Moderated

Refreshing or reseting data in item renderers

Jan 5, 2013 7:55 AM

Tags: #data #flex #tree #list #item #renderers

Hello all,

 

I've been on this issue for about 3 days now, I have googled and nothing is helping at the moment. I have a tree with a custom item renderer that represents different groups of information(Company, Roles and Groups), In this tree, each branch has a different datatype(CompanyInfo Object, Roleinfo Object and GroupInfo Object). The strong typed objects are used to build the tree with CompanyInfo being the root and containing RoleInfo Objects as children which could in turn contain GroupInfo Objects.  At each level, the item Renderer for the tree has a label that displays a total of all users under for that Company, Role or Group. All this works fine as the following code fired by creationComplete handler detects the data type of the data and gets a sum total for that level

 

 

if( data is RoleInfo ) 
{
     count=data.roleCount;
}
else if(data is GroupInfo)
{
      count=data.userCount;
 
}
else if(data is CompanyFolder)
{
     count=data.staffCount;
}
 

 

Now the count variable is scoped within the class itself, but the problem arises when the data provider for the tree changes in which CompanyInfo Object changes and could have different number of roles and groups under it. When this change happens, i can still see traces of the previous data mixed with the new data, Is there any way to reset the item renderer so that the new values can display properly?

 

Any form of help will be greatly appreciated

 

thanks

 
Replies

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points