--- In flexcoders@yahoogroups.com, "g07m5064" <[EMAIL PROTECTED]> wrote:
>
> Hi, I not sure what is missing on my code. In addition to dragging a
> row from a datagrid to a listgrid I would like to have an image
> dragged to the listgrid. I am able to drag the image. However my
> dragEnter function is not working. I would appreciate any help you
> offer. Thanks in advance.
> Mathe
> private function dropHandler(event:DragEvent,format:String):void              
> var targetRow:Object = new Object();                                   var 
> name:Object = new
> Object();
>        if (event.dragSource.dataForFormat("items"))
>        {
>        targetRow = event.dragSource.dataForFormat("items");                   
>  
> liTarget.dataProvider.addItem(targetRow[0].name);
>        }
>       else{
>        name = event.dragSource.hasFormat(format);
>        liTarget.dataProvider.addItem(name);
>       } 
>       event.preventDefault();
> }
>   private function mouseMoveHandler(initiator:Image,
> name:String,event:MouseEvent,format:String):void  
>          {
>              var ds:DragSource = new DragSource();
>              ds.addData(name,format);    
>              DragManager.doDrag(initiator, ds, event);
>           } 
> 
> private function dragEnterHandler(event:DragEvent, format:String):void {
>      if (event.dragSource.hasFormat(format))
>       {                  
> DragManager.acceptDragDrop(IUIComponent(event.target));
>        }
>   }
> <mx:List id="liTarget" dropEnabled="true"
> dragDrop="dropHandler(event,'stringFormat')"                  
> dragEnter="dragEnterHandler(event,'stringFormat')"
> dataProvider="{top}" />       
>               
> <mx:Image id="dragImage" source="assets/{dg.selectedItem.image}" 
>
mouseMove="mouseMoveHandler(dragImage,'{dg.selectedItem.name}',event,'stringFormat')"/>
>

hey guys, 

while we are discussing the similar aspect, could i please add in
another question.

I am currently working on one of the functionalities using drag and
drop feature with the datagrid. I am also using the custom checkbox
renderer inside the data grid. What I am trying to accomplish is to
select all/select the line items in the datagrid and drag them into a
box component living inside an accordion panel on the left side. I
also want to have a counter label living on top of the box, showing
the count of the number of items dropped. This is very much similar to
the kind of feature we see in inbox/outlook functionalities.

Somehow I am not able to refine the drag feature of the datagrid and
the whole functionality doesnt seem as seamless. Could someone please
take a look at my code and see what I am missing. Thank you.

Code: http://meetandbuy.com/VISA/dragDropCheckBox.zip

Reply via email to