Can you post the code from your item renderer and a screenshot of the issue?
My requirement in short is to
1.) Display all Tasks's Actuals rows in brown color.
2.) Display fields that has "Date field" in green color.
If we look at the screenshot, the first one is the actual intended one and the next part has some cells greyed out and some cells coloured unnecessarily. "TBD" has green.All these happened, when we do a scroll.
I have given minimum width and height for easy understanding about the issue.
You need to update the style of your renderers when the data property is set.
override public function set data( value : Object ) : void
super.data = value;
// now update your styles based on the value that's been passed in
am not able to follow you. Did you get a chance to look at my code and the issue Iam facing ? Iam not able to understand how setting the data will resolve my problem.
You are not setting the data, the datagrid does this. You are making sure your styles are up to date each time the data is set. Renderers are recycled during scrolling, so (for example) a renderer for "Item 1" that has scrolled off-screen could be reused for "Item 10" that has scrolled on-screen. When this happens the grid will update the recycled renderer with the new item by setting the renderer's data property. If you don't update your styles at this point then your recycled renderer will retain the styles for "Item 1" even though it is now displaying "Item 10".
I think, am following you a little bit. Sorry to bug you. So, if we are going to use s
tyle function, we must give style for each and every cell. Else, the rendering would pick up the properties from some other cell. Is this the way itemrender behaves now?
1.) Can't we have flex to get default styles, if the style is not set ?
2.) And for my scenario, am setting the background color, can you please let me know on how do I use that in set method ?
I think you are correct to expect the style function to update the renderers appropriately when they are scrolled, so I may be pointing you in the wrong direction. I can't access the code from my current location, but will try to take another look later today.
Really, appreciate your help !
Thanks in advance
I think the problem is in your RowBackground renderer's setStyle function. If styleProp=="backgroundColor" then you are setting the background color. That's all fine, but if the renderer is recycled then the backgroundColor will still be set this way. So if the next time the setStyle function is called the styleProp=="custom" you aren't setting backgroundColor back to the default. The same goes for font color and weight. Every time the setStyle function is called you need to set the new styles and "unset" any styles that were previously set.
I think, Iam understanding your explanation. But, I still have one more doubt. Am not setting the rolloverColor anywhere. But, am wondering why it got changed ?
Thanks in advance
Can you please update at this? Or please advise me whether, we need to log a bug for this.