答案 0 :(得分:2)
选定的行位于通过专用AdvancedDataGrid
实现的Sprite
中,用作绘图画布。要在选择标记中创建边框,您需要根据AdvancedDataGrid
创建自定义类并覆盖受保护的方法drawSelectionIndicator
。
以下示例应生成1px宽红色边框的选择标记:
public class GridWithBorderedSelectionMarker extends AdvancedDataGrid {
override protected function drawSelectionIndicator(
indicator:Sprite, x:Number, y:Number, width:Number,
height:Number, color:uint,
itemRenderer:IListItemRenderer):void {
if (isRowSelectionMode()) {
width = unscaledWidth - viewMetrics.left - viewMetrics.right;
}
var borderColor:uint = 0xff0000;
var g:Graphics = Sprite(indicator).graphics;
g.clear();
g.beginFill(borderColor);
g.drawRect(0, 0, width, height);
g.beginFill(color);
g.drawRect(1, 1, width - 2, height - 2);
g.endFill();
indicator.x = x;
indicator.y = y;
}
}