PDA

View Full Version : DragDrop Tree Save position MySQL



Puzo
2 Jun 2009, 1:33 AM
Hello!

I have a working menu, which obtains data from the MySQL database. Now I would like to upgrade menu in such a way that would allow the dragdrop function (enableDD,draggable) and then save the position in MySQL database.

Here is my Tree menu code:



var Tree_Category_Loader = new Ext.tree.TreeLoader({
dataUrl :"_include/class.tree.php"
})

var Tree_Category = new Ext.tree.TreePanel({
collapsible : false,
animCollapse : false,
id : "tree_projectcategory",
el : "tree_projectcategory",
autoScroll : true,
draggable : false,
animate : true,
enableDD : false,
containerScroll : true,
autoHeight : true,
rootVisible : false,
singleClickExpand: true,
width : 300,
loader : Tree_Category_Loader
})
// SET the root node.
var Tree_Category_Root = new Ext.tree.AsyncTreeNode({
text : 'Start',
draggable : false,
id : '0' // this IS the id of the startnode
})



Can you help me?

moegal
2 Jun 2009, 4:36 AM
Puzo,

Look at the sample at

http://extjs.com/deploy/dev/examples/tree/reorder.html

Then you can use getChecked() to get the info you need, I think.

http://extjs.com/deploy/dev/docs/?class=Ext.tree.TreePanel

I use it like mytree.getChecked('id'). But I think you may want to get the parentNode as well and then take that array and post it in a form via a hidden field or with ajax directly.

Marty

Puzo
2 Jun 2009, 10:04 AM
Thank you for your quick answer. But currently I am not sure where to put what. Can you help me with that ?

Thanks

Puzo
4 Jun 2009, 1:30 AM
Anyone have maybe working example?

jetm
15 Aug 2009, 1:35 PM
I have the same problem and recently I found this example

http://extjs.com/deploy/ext/examples/tree/dependency.html

I hope this help you,

jetm