Hi,
I've tried to implement the tree with PHP here, but is doesnt seem to fetch the data. Can anyone see whats wrong? http://smart-web.dk/test/layout.html
Thanks...
Nice PHP class! After re-working the php class to run with php 4, I was able to get it to function, however I did have to change the following in the display_children function:
EDITED: Apparently after you shut down your laptop and restart everything, the script runs without my previous adjustment. Again thanks for sharing this script! Any plans on expanded it to cover more on the javascript side, such as: add/edit/delete folders, files?
Should there be a error check for possible endless child/parent loop?
Thanks for this hint, but it is not a standalone example. I'm new with Ext and Json and I cannot make it work. Can somebody help ? Some issues :
- js and css files are missing in HTML
- what does this "$_POST['node']" mean in the PHP file ? Where is the form ? I think it's not relevant here and I replaced it by 0.
- there are also "GLOBALS" variables in the code that are not set anywhere. I removed the conditions with them.
- finally, the recursive call to display_children($parent) is not made ! So only the first parent can be displayed. Or do I miss something ?
I don't know how to make this call so that the right array is finally passed to encode_json().
had several problems running this and it never work as it should. item one simple but php needs to be wrapped as php so it will run.
item two the globals in the SQl need to be removed as there not defined, someone else brought this issue up.
item three: initial request sends node = Tree_category_Root but the SQl would be looking for 0 or 1.
added the following before the sql
if ($parent = 'Tree_Category_Root'){
$parent = '0';
}
got results but not correct. in the end I got it to work to the degree that I could see what should occur. but to be honest a newbie would never get the product to work to that level.
Hi
First "$_POST['node']" is very important. There you find the value that first has the name id that you set in the root definition as you have found out by yourselve. I have changed the example so you have a zero there to start with. In the php class, after the select, the parent value is set into the variable id witch is used in the treereader to make the call , now named node.