its not really the way to do it. First you need to disable he drag drop ,drag enter and drag move on trees so that is does not call the default functions when you are dragging an item from the datagrid, then you need to implement the following :
dropEnabled="false" /*Set the property of the tree*/ dragEnabled="false" /*Set the property of the tree*/ dragMoveEnabled="false" /*Set the property of the tree*/ dragEnter="onDragEnter(event)" /*Implement this function*/ dragDrop="onDragDrop(event)" /*Implement this function*/ dragOver="dragOver(event)" /*Implement this function*/ --- In flexcoders@yahoogroups.com, "Nate Pearson" <[EMAIL PROTECTED]> wrote: > > I used preventDefault() with Jim's code and it allows me to drop on > the tree!! Now i just have to code it correctly; although its a task > I am capable of. > > Thanks everyone! > > --- In flexcoders@yahoogroups.com, "Alex Harui" <aharui@> wrote: > > > > preventDefault() is needed to prevent the base class from putting up > > default feedback. > > > > > > > > You may need to override dragDrop event to map the DG data to tree data. > > > > > > > > ________________________________ > > > > From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On > > Behalf Of Nate Pearson > > Sent: Tuesday, May 15, 2007 1:29 PM > > To: flexcoders@yahoogroups.com > > Subject: [flexcoders] Re: Okay, I know this is possible...DataGrid to > > Tree > > > > > > > > I DO want to override dragEnterHandler and AM extending a tree > > component. > > > > I haven't posted to this thread in a while but I still havn't fixed > > it. Anyone know how to drag/drop from a grid to a tree? > > > > --- In flexcoders@yahoogroups.com <mailto:flexcoders% 40yahoogroups.com> > > , "Jim Robson" <jim.robson@> wrote: > > > > > > Nate: > > > > > > If you don't want to extend Tree and override dragEnterHandler, then > > > here's something else to try. > > > > > > In the tree instance's dragEnter handler, add some data with the > > > format "treeItems" like so: > > > > > > var obj:Object = new Object(); > > > event.dragSource.addData(obj,"treeItems"); > > > > > > It may seem klugey, but it works. > > > > > > -Jim > > > > > > On Tue, 24 Apr 2007 16:59:36 -0000 > > > "Nate Pearson" <napearson99@> wrote: > > > > Thanks for the response. > > > > > > > > I've read that document and from what I understand dragEnter doesn't > > > > have to do anything but have the dragmanager.acceptdragdrop. I have > > > > also looked at that list. If you take that same thing and turn it > > > > into a data grid it doesnt work. It's like there is some Datagrid > > > >to > > > > tree conspiracy going on.... > > > > > > > > On dragOver is where i would handle the difference between items and > > > > tree items. I can't however get that function to even fire since it > > > > won't allow drops... > > > > > > > > > > > > --- In flexcoders@yahoogroups.com > > <mailto:flexcoders%40yahoogroups.com> , "Stephen Gilson" <smgilson@> > > > >wrote: > > > >> > > > >> While it is not exactly what you want, there is an example with > > > >>runnable > > > >> code in the updated Drag and Drop doc on the Flex Doc Blog that > > > >>shows > > > >> how to drag from a List to a DataGrid. It requires that you modify > > > >>the > > > >> dragged data as part of the drop to make it compatible with the > > > >> DataGrid. > > > >> > > > >> http://blogs.adobe.com/flexdoc/drag_and_drop/ > > <http://blogs.adobe.com/flexdoc/drag_and_drop/> > > > >> > > > >> One thing to remember when writing the dragEnter handler is that > > for > > > >>all > > > >> controls except for Tree, the format string is "items" and the > > items > > > >> implement the IDataProvider interface. > > > >> For Tree controls the format string is "treeItems" and the items > > > >> implement the ITreeDataProvider API interface. > > > >> > > > >> Stephen > > > >> > > > >> ________________________________ > > > >> > > > >> From: flexcoders@yahoogroups.com > > <mailto:flexcoders%40yahoogroups.com> > > [mailto:flexcoders@yahoogroups.com <mailto:flexcoders% 40yahoogroups.com> > > ] > > > >>On > > > >> Behalf Of Nate Pearson > > > >> Sent: Monday, April 23, 2007 6:04 PM > > > >> To: flexcoders@yahoogroups.com > > <mailto:flexcoders%40yahoogroups.com> > > > >> Subject: [flexcoders] Re: Okay, I know this is possible...DataGrid > > > >>to > > > >> Tree > > > >> > > > >> > > > >> > > > >> Anyone? I'm trying to present a demo tomorrow, this is the thing I > > > >> haven't figured out. > > > >> > > > >> --- In flexcoders@yahoogroups.com > > <mailto:flexcoders%40yahoogroups.com> > > > >><mailto:flexcoders%40yahoogroups.com> > > > >> , "Nate Pearson" <napearson99@> wrote: > > > >> > > > > >> > ...but I haven't seen it yet! I've seen the code but when I run > > it > > > >>it > > > >> > doesn't work! > > > >> > > > > >> > How do allow for a datagrid to drop into a tree? All i need it to > > > > > >>do > > > >> > is have > > > >>DragManger.acceptDragDrop(UIComponent(event.currentTarget)) > > > >> > on drag enter work! Everytime i do it I get a little red x. > > > >> > > > > >> > Anyone have any code/examples to show me? If you say "override > > > >> > dragEnter and put > > > >> > DragManager.acceptDragDrop(UIComponent (event.currentTarget)) i > > > >>wont > > > >> > believe you! ;). > > > >> > > > > >> > Seriously, I've worked on this all weekend to no avail :(. I'm > > > >>going > > > >> > to dell taco now and I hope someone can help me by the time I'm > > > >>back. > > > >> > > > > >> > > > > > > > > > > > > > >