AdvancedDataGrid headers rollover color

来源:互联网 发布:usb端口上的电源 编辑:程序博客网 时间:2024/06/13 06:26

Problem

While styling my application, I wanted the color of each row of my AdvancedDataGrid to change when rolled over, but I didn't want the same effect for the headers, which happens by default.

Solution

I override the mouseOverHandler function for AdvancedDataGrid to not run if the item being rolled over was a header item.

Detailed explanation

Line 12 of source file NoHeaderRolloverADG.mxml makes use of the AdvancedDataGrid method isHeaderItemRenderer, which is passed any itemRenderer, and returns a Boolean to say whether the renderer is a header renderer or not. If it is a header renderer the method is exited, and no further logic is run, otherwise, the default handler is called.

CustomADG.zip
[Source files for example.]
HeaderRolloverDefault.gif
HeaderRolloverWithOverride.gif
原创粉丝点击