Boa noite, Como eu posso arrastar a copia de um itemrenderer de um list para outro evitando duplicidade mas sem o uso do dragMoveEnabled?
Aplicando isso ao exemplo: <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"> <mx:Script> <![CDATA[ import renderers.ShoppingCartRenderer; import mx.events.DragEvent; import mx.core.UIComponent; import mx.managers.DragManager; import mx.collections.ArrayCollection; [Bindable] private var shoppingCartArray:Array = [ {id:1,name:"Snow Peas", price:1.23, quantity:1, units:"lbs"}, {id:2,name:"Herb Tofu", price:4.50, quantity:1, units:"pkg"}, {id:3,name:"Jasmine Rice", price:5.25, quantity:1, units:"pkg"}, {id:4,name:"Mandarin Oranges", price:1.19, quantity: 1,units:"can"}, {id:5,name:"Barbeque Potato Chips", price:3.15, quantity:1, units:"bag"}, {id:6,name:"2% Milk", price:4.95, quantity:1, units:"pkg"}, {id:7,name:"Chocolate Soy Milk", price:5.10, quantity:1, units:"pkg"}, {id:8,name:"Paper Towels", price:6.50, quantity:1, units:"6 rolls"}, {id:9,name:"Pet Food", price:.56, quantity:6, units:"can"}, {id:10,name:"Whole Wheat Pasta", price:3.89, quantity:1, units:"pkg"}, {id:11,name:"Sesame Bagels", price:4.19, quantity:1, units:"pkg"}]; [Bindable] public var pedido:Array = []; private function CartTotal():void { var total:Number = 0; for(var i:int=0; i < pedidoCar.length; i++) { var record:Object = pedidoCar.getItemAt(i); total += record.price*record.quantity; } cartPed.text = cfmt.format(total); //test.text = i.toString(); } private function deleteProd(evt:Event):void { if (ped.selectedIndex != -1) { pedidoCar.removeItemAt(ped.selectedIndex); } } ]]> </mx:Script> <mx:CurrencyFormatter id="cfmt" precision="2" /> <mx:ArrayCollection id="shoppingCartDB" source="{shoppingCartArray}" collectionChange="CartTotal()" /> <mx:ArrayCollection id="pedidoCar" source="{pedido}" collectionChange="CartTotal()" /> <mx:List id="pro" dataProvider="{shoppingCartDB}" x="481" y="266" width="421" labelField="quantity" alternatingItemColors="[0xEFEFEF,0xFFFFFF]" editable="true" itemRenderer="renderers.ShoppingCartRenderer" editorDataField="quantity" textAlign="right" dragDrop="onDragDrop(event)" dragMoveEnabled="false" rendererIsEditor="true" dragEnabled="true" itemClick="dropEnable()"> </mx:List> <mx:List id="ped" x="10" y="266" width="421" dataProvider="{pedidoCar}" labelField="quantity" alternatingItemColors="[0xEFEFEF,0xFFFFFF]" editable="true" itemRenderer="renderers.ShoppingCartRenderer" editorDataField="quantity" textAlign="right" dragMoveEnabled="false" rendererIsEditor="true" dragDrop="CartTotal()" itemEditEnd="CartTotal()" dropEnabled="true" dragEnabled="true" itemClick="deleteProd(event);"> </mx:List> <mx:Label x="360" y="486" id="cartPed" text="0" width="71" textAlign="right" fontWeight="bold" fontSize="12"/> <mx:Label id="test" x="10" y="488" width="102"/> </mx:Application> ##################### itemRenderer ################################### <?xml version="1.0" encoding="utf-8"?> <mx:HBox xmlns:mx="http://www.adobe.com/2006/mxml" verticalAlign="middle" paddingRight="4" paddingLeft="4" > <mx:Script> <![CDATA[ public function get quantity() : Number { return itemQuantity.value; } ]]> </mx:Script> <mx:CurrencyFormatter id="cfmt" precision="2" /> <mx:Label text="{data.name}" fontWeight="bold" fontSize="12"/> <mx:Spacer width="100%"/> <mx:NumericStepper id="itemQuantity" value="{data.quantity}" minimum="0" maximum="100"/> <mx:Label text="{cfmt.format(data.price*itemQuantity.value)}" width="66"/> </mx:HBox> --~--~---------~--~----~------------~-------~--~----~ Você recebeu esta mensagem porque está inscrito na lista "flexdev" Para enviar uma mensagem, envie um e-mail para flexdev@googlegroups.com Para sair da lista, envie um email em branco para flexdev-unsubscr...@googlegroups.com Mais opções estão disponíveis em http://groups.google.com/group/flexdev -~----------~----~----~----~------~----~------~--~---