Any reason you are not using the List.calculateDropIndex() method?

 

Tracy Spratt 
Lariat Services 

Flex development bandwidth available 

________________________________

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of Adrian Williams
Sent: Tuesday, January 27, 2009 4:33 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] DataGrid Drop Deny based on dropIndex

 

Hi,

We handle something very similar to this, and although we don't deny a
drop based on the index, we use the index to persist the drop location
in the database...the same logic applies.  We are using this on an ADG
and hence my example below:

You could grab the internal targetGrids dropData get the
dropData.index...check it and if its not the value you want, perform an
event.preventDefault and stopPropagation...

private function adg_DragEvent(event:DragEvent):void
{
    var targetGrid:AdvancedDataGrid = event.currentTarget as
AdvancedDataGrid;

    use namespace mx_internal;
    var dropData:Object = targetGrid.mx_internal::_dropData;

    adgIndex = dropData.index;

    if (adgIndex > 4)
    {
        targetGrid.hideDropFeedback(event);
        targetGrid.selectedItems = new Array();
        event.preventDefault();
        event.stopPropagation();
    }
}
       
HTH!
Adrian


park96 wrote: 

        Anyone have an example of how to deny a drop based on the drop
index?
        The problem I'm facing is that even though my dragEnter event
handler
        doesn't call the DragManager.acceptDragDrop(UIComponent), it
still
        allows me to drop it.

 

Reply via email to