开发者

Drag and drop between List control and Chart

开发者 https://www.devze.com 2022-12-20 18:49 出处:网络
I am trying to implement a drag and drop function between a list control and a columnchart in Flex3. List items should, when dragged and dropped on the chart, be displayed graphically in the columncha

I am trying to implement a drag and drop function between a list control and a columnchart in Flex3. List items should, when dragged and dropped on the chart, be displayed graphically in the columnchart. Alas, dropping the listitems on the chart does not seem to result in a proper graph. Here my code till so far with regard to the drop part:

private function doDragDrop(event:DragEvent):void{

var ds:DragSource = event.dragSource; var dropTarget:ChartBase=ChartBase(event.currentTarget); var items:Array = ds.dataForFormat("items") as Array;

for(var i:uint=0; i < items.length; i++)开发者_JAVA百科 { if (dropTarget.dataProvider.contains(items[i].item)) { } else { dropTarget.dataProvider.addItem(items[i].item);

} } }

I am pretty new to Flex; any help is greatly appreciated!


Here is a drag and drop sample that might help:

http://flexexamples.blogspot.com/2007/12/flex-drag-and-drop-custom-class-source.html

0

精彩评论

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