RE: [flexcoders] Re: Okay, I know this is possible...DataGrid to Tree
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 [EMAIL PROTECTED] 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 - Nate Pearson [EMAIL PROTECTED] 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.
RE: [flexcoders] Re: Okay, I know this is possible...DataGrid to Tree
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/ 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:[EMAIL PROTECTED] On Behalf Of Nate Pearson Sent: Monday, April 23, 2007 6:04 PM To: flexcoders@yahoogroups.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 , Nate Pearson [EMAIL PROTECTED] 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.
Re: [flexcoders] Re: Okay, I know this is possible...DataGrid to Tree
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 - Nate Pearson [EMAIL PROTECTED] 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, Stephen Gilson [EMAIL PROTECTED] 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/ 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:[EMAIL PROTECTED] On Behalf Of Nate Pearson Sent: Monday, April 23, 2007 6:04 PM To: flexcoders@yahoogroups.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 , 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.