在实现手动拖放功能时,我正在尝试将火花列表 ItemRenderer 添加为 DragInitiator。下面的示例将整个列表作为一个 dragInitiator。问题是在这种情况下如何使用 Itemrenderer?
protected function myList_dragStartHandler(event:DragEvent):void
{
var dragInitiator:List = event.currentTarget as List;
var selectedQuery:Object = List(event.dragInitiator).selectedItem;
var ds:DragSource = new DragSource();
ds.addData(selectedQuery, "query");
DragManager.doDrag(dragInitiator, ds, event);
}
<s:List id="myList" y="10" height="273" dataProvider="{sqList}" labelField="desc" itemRenderer="SqItemRenderer"
dragEnabled="true" dragStart="myList_dragStartHandler(event)"/>