PDA

View Full Version : Newby-problem: nodes repeating in tree-example



bf69
21 Jun 2010, 10:12 PM
Hi all,

I'm completely new to ExtJS, but I love what you can do with it. I'm fairly experienced with PHP, and I'm taking on the challenge of ExtJS.

I searched for a couple of examples, and I found a nice basic layout on another site. Next I wanted to integrate the tree-example in this lay-out. I got it to work, but I have a nasty little problem. When I open a folder in my example it repeats the complete nodelist inside that folder. It must be something very obvious, but I'm missing the bug in my code...

Could someone give me a hint where I went wrong?

I've put my test online. Please don't name the URL because I don't want it in Google just yet. Therefore I'm using a redirect-URL: http://tiny.cc/8tk54

Animal
21 Jun 2010, 10:59 PM
They are the nodes your get-nodes.php is sending!

bf69
22 Jun 2010, 5:21 AM
Doh... I was still thinking in PHP-terms, and therefore I constructed the get-nodes.php so that the complete list was returned, instead of just the part that needed to be displayed. I adjusted that bit, and that works fine now.

It's a bit of turn in the way you have to think when coming from PHP...

I do have one more question for now, is there a way to put restrictions on the drag'n'drop-movements that can be made? In my example I can imagine that I don't want folders to slide into each other. That would basicly leave the possibilities limited to shuffling them around, and draging the leaf-items around among the folders. I did find something that I think could be used for this (here (http://www.sencha.com/forum/showthread.php?40034-TreePanel-Restrict-drag-drop-to-within-parent-node-only&p=193731#post193731)), but I do not know exactly how to implement it...

Animal
22 Jun 2010, 5:34 AM
http://www.sencha.com/deploy/dev/docs/?class=Ext.tree.TreePanel&member=beforenodedrop

bf69
22 Jun 2010, 5:39 AM
Man, you are fast!

Thanks for the pointer, I'm going to take a look at it!