Thanks Alex,

I tried to follow the Flex classes to see what was happening (although I
couldn't access DragManagerImpl
or IDragManager). Looks as if dragImage is an instance of DataGridDragProxy,
so I created my own subclass (which does nothing but create and populate a
Label for the moment) and I also called preventDefault() as suggested.

I don't see the label, and also as soon as doDrag() has been called I get
the red circle icon, indicating that I can no longer drag and drop items
within the grid (my DataGrid is set up so that dragEnabled and dropEnabled
are both true).

If it helps here is the code:

private function onDragStart(event:DragEvent):void
{
    event.preventDefault();

    var dragInitiator:IUIComponent = event.dragInitiator;
    var dragSource:DragSource = new DragSource();
    dragSource.addData("abcdefg", "text");

    //created a subclass which overrides createChildren and
creates/populates/adds a Label
    var dragImage:DataGridDragProxy = new MyDataGridDragProxy();
    DragManager.doDrag(dragInitiator,dragSource, event, dragImage);
}

Cheers,
Neil


On Mon, May 12, 2008 at 6:30 PM, Alex Harui <[EMAIL PROTECTED]> wrote:

>    It isn't the DragProxy you want to change, but probably just the
> dragImage handed into DragManager.doDrag.  The place to do that is in a
> handler for DRAG_START where you call preventDefault() so the default
> dragImage isn't used.  You can also subclass and override dragImage.
>
>
>  ------------------------------
>
> *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On
> Behalf Of *nwebb
> *Sent:* Monday, May 12, 2008 7:04 AM
> *To:* flexcoders@yahoogroups.com
> *Subject:* Re: [flexcoders] Drag and Drop (modify default dragProxy)
>
>
>
> Hi Douglas,
>
> thanks for the reply - yeah that's pretty much what I have at the moment
> (I capture the data on MouseDown and create/display a Label on MouseMove),
> but I thought it could be a little cleaner and so I was hoping I could
> access the current dragProxy, use the existing data within it, all within
> the MouseMove method.
>
> This is what I currently have:
>
> //Capture the row data when the user clicks on an item...
> private function dropZoneMouseDown(event:MouseEvent):void
> {
>     var selectedData:XML = DataGrid(event.currentTarget).selectedItem as
> XML;
>     _lastSelectedName = [EMAIL PROTECTED];
>     _lastSelectedAge = [EMAIL PROTECTED];
> }
>
> private function dropZoneMouseMove(event:MouseEvent):void
> {
>     var dragInitiator:IUIComponent = event.target as IUIComponent;
>     var dragSource:DragSource = new DragSource();
>     var dragProxy:Label = _dragLabel;
>     dragProxy.text = _lastSelectedName + "  " + _lastSelectedAge;
>     DragManager.doDrag(dragInitiator, dragSource, event, dragProxy);
>  }
>
> Cheers,
> Neil
>
>
>  On Mon, May 12, 2008 at 2:41 PM, Douglas Knudsen <
> [EMAIL PROTECTED]> wrote:
>
> perhaps you can create a Label with the text from these twocolumns and
> then use this method
> http://livedocs.adobe.com/flex/3/html/dragdrop_7.html#226768
>
> DK
>
>
>
> On Mon, May 12, 2008 at 8:40 AM, nwebb <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> I'm drag/dropping items within a DataGrid. I would like to modify the
> default dragProxy label that is shown when you drag an item.
>
> (i.e. my DataGrid may have 4 columns, but I only want to show text from
> the last two columns).
>
> Does anyone know how to access it?
>
>
>
>   --
> Douglas Knudsen
> http://www.cubicleman.com
> this is my signature, like it?
>
>
>
>  
>

Reply via email to