views:

696

answers:

2

Say I have this AdvancedDataGrid:

<mx:AdvancedDataGrid id="grid"
 height="384"
 width="100%"
 styleName="aStyleName"
 displayItemsExpanded="false"
 groupItemRenderer="SomeRenderer"
 draggableColumns="false"
 defaultLeafIcon="{null}"
 folderClosedIcon="{null}"
 folderOpenIcon="{null}">
 <mx:columns> 
  <!-- a bunch of AdvancedDatagridColumns -->
 </mx:columns>
</mx:AdvancedDataGrid>

which works like a tree, i.e., certain nodes are "collections" that can be collapsed and expanded.

The style for this grid has an alternating-item-color array specified. The array length is 2, meaning rows alternate between light and dark.

The problem is, even with a custom groupItemRenderer, the alternating rows very obnoxiously alternate :) no matter whether the row is an expandable node or a data row. The row immediately beneath any expandable row right now could be either color, and the expandable row gets the color too. My preference is for the light-dark alternation to skip the expandable rows and restart light-dark sequence after each row, but skip the expandable row entirely.

I made the groupItemRenderer take up however many columns are displayed and gave it a gray background, but the row color still displays behind the item renderer, even though the height of the render is set to 100%.

If I haven't lost everybody at this point, does anyone have any ideas about how to do this? Do I have to extend AdvancedDataGrid and override the drawRowBackgrounds method, or is there a simpler solution?

A: 

I'm currently trying to just get a groupItemRenderer working properly. I've made my item renderer, but I don't know what functionality to implement within it to simulate the folder open/close click. I'm assuming there is some event that I need to throw, but I haven't found a good example for that, I'm assuming you've already passed this hurdle based on your question.

Jeff Hilleman
Please don't ask a question as an answer. It's not likely to get noticed and it screws up the accept rate. Your question can't possibly be an acceptable answer, yet it counts as a candidate. This is not a bad question, but I suggest you withdraw it from here and add it as a top-level question. Otherwise I have to either close this question or answer it "I don't know" and check it answered.
Robusto
A: 

My solution, unsatisfactory as it may be, is to use no alternating rows colors. I would like to have kept this open, because it still doesn't accomplish what I want to do, but someone responded to this question with a question of his own, not an answer to my question, thereby dragging down my accept rate. If someone comes along with a good answer, I will uncheck this response and check that one. Sorry, but I'm not sure what else to do here.

Robusto