开发者

Flex AdvancedDataGrid with expandable nodes: possible to make the alternatingItemColors start fresh after each expandable node?

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>开发者_Go百科

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?


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜