【问题标题】:Datagrid select multiple item by click and dragDatagrid通过单击并拖动选择多个项目
【发布时间】:2015-11-17 11:01:14
【问题描述】:
有没有办法通过单击和拖动来选择DataGrid 中的多个项目(即 - 单击顶部项目并将鼠标拖动到下面的项目将全部选中)?
我启用了allowMultipleSelection,因此我可以使用 shift 和 ctrl 键选择多个项目,但是有没有办法只使用 鼠标点击?
即使启用allowDragSelection,它也不起作用。
感谢您的帮助。
【问题讨论】:
标签:
actionscript-3
apache-flex
flash-builder
【解决方案1】:
你可以...
private function mouseDown(e:MouseEvent):void
{
addEventListener(MouseEvent.MOUSE_MOVE, handleMouseMove);
}
private function handleMouseMove(e:MouseEvent):void
{
//Code to get display object if mouseX and Y is intercepting a cell
//Tell said cell that it has been selected
}
private function mouseUp(e:MouseEvent):void
{
removeEventListener(MouseEvent.MOUSE_MOVE, handleMouseMove);
}
Here's 一些来自快速搜索如何检测鼠标是否在显示对象上。应用它就可以了。