RE: [flexcoders] Flex2B3 - Drag And Drop - Drop Into Tree (different from B2)

2006-05-11 Thread Jason Hawryluk



I've been having allot of problems as well with the tree and drag drop
operations. Specifically if the fact that the tree does not update properly
now, as it did before with relation to it's data source. Also I’m finding
that the drop indicator is all over the place. Are you experiencing the same
problems ?

Anyway to answer your question:

the below line should give you the node your over.

var currNodeOver:Object =
currTree.indexToItemRenderer(currTree.calculateDropIndex(event)).data;


then to get the drop parent would be something like

var myparent:object = getParentItem(currNodeOve);

Hope that helps.

Jason


-Message d'origine-
De : flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] la
part de Andrea Varga
Envoyé : jeudi 11 mai 2006 10:42
À : flexcoders@yahoogroups.com
Objet : [flexcoders] Flex2B3 - Drag And Drop - Drop Into Tree (different
from B2)


Hi All

I'm having difficulty with the drop part of the drag and drop in a Tree
in B3.

I have my tree defined this way:
mx:Tree id=myTree
 dataProvider={myTreeData}
 dragEnter=doDragEnterTree(event);
 dragDrop=doDragDropTree(event);/

And I have this method for dragDrop:

private function doDragDropTree(event:DragEvent):void {
 trace(DROP IN TREE index: + myTree.calculateDropIndex(event));
}

This works well. My problem is: I want to know WHERE exacty the drop was
fired (where did the user released the mouse button) to know where the
insert my new item. The calculateDropIndex works well for List type
components, but for a Tree it is useless. It returns a level number.

In B2 the Tree had a method Tree.getDropParent(event), I suppose this
returned what I was looking for, but in B3 the Tree has no such a
method. In Flex Beta 2 to Beta 3 Changes it says:

Tree.getDropParent(event) - Use Tree.getParentItem(item:Object):*.

But I don't understand the logic here. getParentItem() has as parameter
item:Object, and I don't kno that, I know just an event, I want to find
out the item:Object.

What is the solution here?

Thanks for your help!

Andi


PS. My messages appear on the list with more than 8 hours delay  Why?







--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com



SPONSORED LINKS Web site design development Computer software development
Software design and development
Macromedia flex Software development best practice



YAHOO! GROUPS LINKS

 Visit your group flexcoders on the web.

 To unsubscribe from this group, send an email to:
 [EMAIL PROTECTED]

 Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.









--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com








  
  
SPONSORED LINKS
  
  
  

Web site design development
  
  
Computer software development
  
  
Software design and development
  
  


Macromedia flex
  
  
Software development best practice
  

   
  







  
  
  YAHOO! GROUPS LINKS



  Visit your group "flexcoders" on the web.
  To unsubscribe from this group, send an email to:[EMAIL PROTECTED]
  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.



  











RE: [flexcoders] Flex2B3 - Drag And Drop - Drop Into Tree (different from B2)

2006-05-11 Thread Jason Hawryluk



Actually your right it is giving the level, g.. i have not fully
tested since beta 3 but a trace shows that it does in fact not get you the
specific item.

I'm also interested in figuring this out. Please keep me up to date with
your progress, i'll do the same. :)

Jason




-Message d'origine-
De : flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] la
part de Jason Hawryluk
Envoyé : jeudi 11 mai 2006 13:22
À : flexcoders@yahoogroups.com
Objet : RE: [flexcoders] Flex2B3 - Drag And Drop - Drop Into Tree (different
from B2)


I've been having allot of problems as well with the tree and drag drop
operations. Specifically if the fact that the tree does not update properly
now, as it did before with relation to it's data source. Also I’m finding
that the drop indicator is all over the place. Are you experiencing the same
problems ?

Anyway to answer your question:

the below line should give you the node your over.

var currNodeOver:Object =
currTree.indexToItemRenderer(currTree.calculateDropIndex(event)).data;


then to get the drop parent would be something like

var myparent:object = getParentItem(currNodeOve);

Hope that helps.

Jason


-Message d'origine-
De : flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] la
part de Andrea Varga
Envoyé : jeudi 11 mai 2006 10:42
À : flexcoders@yahoogroups.com
Objet : [flexcoders] Flex2B3 - Drag And Drop - Drop Into Tree (different
from B2)


Hi All

I'm having difficulty with the drop part of the drag and drop in a Tree
in B3.

I have my tree defined this way:
mx:Tree id=myTree
 dataProvider={myTreeData}
 dragEnter=doDragEnterTree(event);
 dragDrop=doDragDropTree(event);/

And I have this method for dragDrop:

private function doDragDropTree(event:DragEvent):void {
 trace(DROP IN TREE index: + myTree.calculateDropIndex(event));
}

This works well. My problem is: I want to know WHERE exacty the drop was
fired (where did the user released the mouse button) to know where the
insert my new item. The calculateDropIndex works well for List type
components, but for a Tree it is useless. It returns a level number.

In B2 the Tree had a method Tree.getDropParent(event), I suppose this
returned what I was looking for, but in B3 the Tree has no such a
method. In Flex Beta 2 to Beta 3 Changes it says:

Tree.getDropParent(event) - Use Tree.getParentItem(item:Object):*.

But I don't understand the logic here. getParentItem() has as parameter
item:Object, and I don't kno that, I know just an event, I want to find
out the item:Object.

What is the solution here?

Thanks for your help!

Andi


PS. My messages appear on the list with more than 8 hours delay  Why?







--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com



SPONSORED LINKS Web site design development Computer software development
Software design and development
Macromedia flex Software development best practice



YAHOO! GROUPS LINKS

Visit your group flexcoders on the web.

To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.





--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com



SPONSORED LINKS Web site design development Computer software development
Software design and development
Macromedia flex Software development best practice



YAHOO! GROUPS LINKS

 Visit your group flexcoders on the web.

 To unsubscribe from this group, send an email to:
 [EMAIL PROTECTED]

 Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.









--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com








  
  
SPONSORED LINKS
  
  
  

Web site design development
  
  
Computer software development
  
  
Software design and development
  
  


Macromedia flex
  
  
Software development best practice
  

   
  







  
  
  YAHOO! GROUPS LINKS



  Visit your group "flexcoders" on the web.
  To unsubscribe from this group, send an email to:[EMAIL PROTECTED]
  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.



  












RE: [flexcoders] Flex2B3 - Drag And Drop - Drop Into Tree (different from B2)

2006-05-11 Thread Jason Hawryluk



So after a little more investigation the internals of the tree control are
using the same method, hence the reason that the indicator seems to bounce
around. i.e. it's not taking into consideration that it is a hierarchical
data structure and only considering it is a flat list that is why we can't
get the drop loc and the separator is only being applied to the first level.
Or, it would seem that is the case. This is my assumption (I really wish to
be corrected).

I really need to find a work around until the next beta, as for me, this is
a real show stopper.

Jason Hawryluk

 -Message d'origine-
De : flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] la
part de Jason Hawryluk
Envoyé : jeudi 11 mai 2006 13:51
À : flexcoders@yahoogroups.com
Objet : RE: [flexcoders] Flex2B3 - Drag And Drop - Drop Into Tree (different
from B2)


Actually your right it is giving the level, g.. i have not fully
tested since beta 3 but a trace shows that it does in fact not get you the
specific item.

I'm also interested in figuring this out. Please keep me up to date with
your progress, i'll do the same. :)

Jason




-Message d'origine-
De : flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] la
part de Jason Hawryluk
Envoyé : jeudi 11 mai 2006 13:22
À : flexcoders@yahoogroups.com
Objet : RE: [flexcoders] Flex2B3 - Drag And Drop - Drop Into Tree (different
from B2)


I've been having allot of problems as well with the tree and drag drop
operations. Specifically if the fact that the tree does not update properly
now, as it did before with relation to it's data source. Also I’m finding
that the drop indicator is all over the place. Are you experiencing the same
problems ?

Anyway to answer your question:

the below line should give you the node your over.

var currNodeOver:Object =
currTree.indexToItemRenderer(currTree.calculateDropIndex(event)).data;


then to get the drop parent would be something like

var myparent:object = getParentItem(currNodeOve);

Hope that helps.

Jason


-Message d'origine-
De : flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] la
part de Andrea Varga
Envoyé : jeudi 11 mai 2006 10:42
À : flexcoders@yahoogroups.com
Objet : [flexcoders] Flex2B3 - Drag And Drop - Drop Into Tree (different
from B2)


Hi All

I'm having difficulty with the drop part of the drag and drop in a Tree
in B3.

I have my tree defined this way:
mx:Tree id=myTree
 dataProvider={myTreeData}
 dragEnter=doDragEnterTree(event);
 dragDrop=doDragDropTree(event);/

And I have this method for dragDrop:

private function doDragDropTree(event:DragEvent):void {
 trace(DROP IN TREE index: + myTree.calculateDropIndex(event));
}

This works well. My problem is: I want to know WHERE exacty the drop was
fired (where did the user released the mouse button) to know where the
insert my new item. The calculateDropIndex works well for List type
components, but for a Tree it is useless. It returns a level number.

In B2 the Tree had a method Tree.getDropParent(event), I suppose this
returned what I was looking for, but in B3 the Tree has no such a
method. In Flex Beta 2 to Beta 3 Changes it says:

Tree.getDropParent(event) - Use Tree.getParentItem(item:Object):*.

But I don't understand the logic here. getParentItem() has as parameter
item:Object, and I don't kno that, I know just an event, I want to find
out the item:Object.

What is the solution here?

Thanks for your help!

Andi


PS. My messages appear on the list with more than 8 hours delay  Why?







--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com



SPONSORED LINKS Web site design development Computer software development
Software design and development
Macromedia flex Software development best practice



YAHOO! GROUPS LINKS

Visit your group flexcoders on the web.

To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.





--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com



SPONSORED LINKS Web site design development Computer software development
Software design and development
Macromedia flex Software development best practice



YAHOO! GROUPS LINKS

Visit your group flexcoders on the web.

To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.





--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com



SPONSORED LINKS Web site design development Computer software development
Software design and development
Macromedia flex Software development best practice



YAHOO! GROUPS LINKS

 Visit your group flexcoders on the web

Re: [flexcoders] Flex2B3 - Drag And Drop - Drop Into Tree (different from B2)

2006-05-11 Thread Andrea Varga
Jason Hawryluk wrote:

I've been having allot of problems as well with the tree and drag drop
operations. Specifically if the fact that the tree does not update properly
now, as it did before with relation to it's data source. Also I’m finding
that the drop indicator is all over the place. Are you experiencing the same
problems ?
  

This is interesting (meaning strange :)). I was having the exact 
opposite problem
I want to drag from a List and drop into a Tree. I always had the redX 
icon there, even when I called the acceptDragDrop, and the drop was 
excepted too.
The only way I could find to solve the problem was leaving out the: 
dropEnabled=true on the Tree.
It is really strange, because I thought that this is mandatory to be 
able to drop on the Tree.
Below is my test code in case you are interested.

Andi



?xml version=1.0 encoding=utf-8?
mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=absolute
xmlns:ns1=*
creationComplete=onCreationComplete()
mx:Script
![CDATA[
import mx.containers.Canvas;
import mx.managers.DragManager;
import mx.events.DragEvent;
import mx.collections.ArrayCollection;

[Bindable]
public var myListData:ArrayCollection;
[Bindable]
public var myTreeData:Object;

private function onCreationComplete():void {
myListData = new ArrayCollection([{name: 'aaa'},{name: 'bbb'},{name: 
'ccc'}]);
}

private function initTree():void {
myTreeData = {label: 'top', children:
[{label: 'level1_A',
children:
[{label: 'level2_1'},
{label: 'level2_2'}]},
{label: 'level1_B', children:
[{label: 'level2_x'},
{label: 'level2_y'}]}
]};

//expand Tree
expandTreeNode(myTree, myTree.dataProvider[0]);
}

public function expandTreeNode(tmpTree:Tree, node:Object):void {
tmpTree.expandItem(node, true);
if(node.children != undefined) {
for(var k:Number=0; k  node.children.length; k++){
expandTreeNode(tmpTree, node.children[k]);
}
}
}

private function doDragOverTree(event:DragEvent):void {
DragManager.showFeedback(DragManager.NONE);
}

private function doDragEnterTree(event:DragEvent):void {

var dragTarget:Tree = Tree(event.currentTarget);
if ((DataGrid(event.dragInitiator).id == 'myList')){
DragManager.acceptDragDrop(dragTarget);
trace(DO DRAG ENTER accept drag into +dragTarget);
}
}

private function doDragDropTree(event:DragEvent):void {
trace(DROP IN TREE index: + myTree.calculateDropIndex(event));

trace(' dropevent[currentTarget] = '+event['currentTarget']);

}

]]
/mx:Script
mx:DataGrid id=myList x=46 y=28 dataProvider={myListData}
dragEnabled=true
mx:columns
mx:DataGridColumn headerText=Name dataField=name /
/mx:columns
/mx:DataGrid
mx:Tree id=myTree x=46 y=242 width=200 height=400
dataProvider={myTreeData}
dropEnabled=true
dragEnter=doDragEnterTree(event);
dragDrop=doDragDropTree(event);

creationComplete=initTree();/
/mx:Application


 Yahoo! Groups Sponsor ~-- 
Everything you need is one click away.  Make Yahoo! your home page now.
http://us.click.yahoo.com/AHchtC/4FxNAA/yQLSAA/nhFolB/TM
~- 

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 




RE: [flexcoders] Flex2B3 - Drag And Drop - Drop Into Tree (different from B2)

2006-05-11 Thread Paul Williams



Hi Jason,

I've raised a bug regarding the location of the default drop feedback bar in the Tree control.

Thanks,

Paul

-Original Message-
From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Jason Hawryluk
Sent: Thursday, May 11, 2006 12:22 PM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] Flex2B3 - Drag And Drop - Drop Into Tree (different from B2)

I've been having allot of problems as well with the tree and drag drop
operations. Specifically if the fact that the tree does not update properly
now, as it did before with relation to it's data source. Also I'm finding
that the drop indicator is all over the place. Are you experiencing the same
problems ?

Anyway to answer your question:

the below line should give you the node your over.

var currNodeOver:Object =
currTree.indexToItemRenderer(currTree.calculateDropIndex(event)).data;


then to get the drop parent would be something like

var myparent:object = getParentItem(currNodeOve);

Hope that helps.

Jason


-Message d'origine-
De : flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] la
part de Andrea Varga
Envoyé : jeudi 11 mai 2006 10:42
À : flexcoders@yahoogroups.com
Objet : [flexcoders] Flex2B3 - Drag And Drop - Drop Into Tree (different
from B2)


Hi All

I'm having difficulty with the drop part of the drag and drop in a Tree
in B3.

I have my tree defined this way:
mx:Tree id=myTree
 dataProvider={myTreeData}
 dragEnter=doDragEnterTree(event);
 dragDrop=doDragDropTree(event);/

And I have this method for dragDrop:

private function doDragDropTree(event:DragEvent):void {
 trace(DROP IN TREE index: + myTree.calculateDropIndex(event));
}

This works well. My problem is: I want to know WHERE exacty the drop was
fired (where did the user released the mouse button) to know where the
insert my new item. The calculateDropIndex works well for List type
components, but for a Tree it is useless. It returns a level number.

In B2 the Tree had a method Tree.getDropParent(event), I suppose this
returned what I was looking for, but in B3 the Tree has no such a
method. In Flex Beta 2 to Beta 3 Changes it says:

Tree.getDropParent(event) - Use Tree.getParentItem(item:Object):*.

But I don't understand the logic here. getParentItem() has as parameter
item:Object, and I don't kno that, I know just an event, I want to find
out the item:Object.

What is the solution here?

Thanks for your help!

Andi


PS. My messages appear on the list with more than 8 hours delay  Why?







--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com



SPONSORED LINKS Web site design development Computer software development
Software design and development
Macromedia flex Software development best practice



YAHOO! GROUPS LINKS

 Visit your group flexcoders on the web.

 To unsubscribe from this group, send an email to:
 [EMAIL PROTECTED]

 Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.






--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links



 








--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com








  
  
SPONSORED LINKS
  
  
  

Web site design development
  
  
Computer software development
  
  
Software design and development
  
  


Macromedia flex
  
  
Software development best practice
  

   
  







  
  
  YAHOO! GROUPS LINKS



  Visit your group "flexcoders" on the web.
  To unsubscribe from this group, send an email to:[EMAIL PROTECTED]
  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.