Some modifications to ponder about

Moderators: Calcifer, slothy

Some modifications to ponder about

Postby kimss » Tue Mar 03, 2009 8:09 pm

I have looked into the folder tree now, and after some modifications and customization I have some things still to be solved from this script to make it perfect. By the way - the script itself is great, but you know how it is - it never fits the bill perfectly, :D Well - it should - since I know we are most likely using it for the same purpose, :)

It could be I have not seen the functions yet, however I am working with the JSDragDropTree() function.

What I would like to see is:
1. Possibility of checkboxes, so it's possible to do selections from the tree.
2. Possibility to disable the drag'n'drop feature, in "selection" mode you do not neccersarily need the users to sort the tree.
3. Disable the right mouse button for drag'n'drop, since most browsers have other functionality attached to right click this becomes confusing.

I already solved the checkboxes, this is simple enough.

Your setup is:

<li id="nodeID"><a href="#"></li>

Easily extended, without breaking edit mode:
<li id="nodeID"><input..."><a href="#"></li>

However the checkboxes then comes infront of the open/close arrows, it should be between the folder and the open/close arrows. However modifying your script to to this breaks renameItem() function. By saying this, I should be shameful and just fix that aswell. However then the script would quickly differ pretty much from yours on this site.

I would also like to point out that your saveNodes.php script is missing an important piece of logic which I am about to solve right now - the sorting. Your update is correct, you update the database and the nodes releationships. This is correct, however the sorting get's messed up. That is - your JS-string is correct, it's the database backend which messes it up. What you need to to - atleast this is my initial idea - is this:

1. Pull your entire structure
2. Truncate the table
3. Reinsert the structure as served from the JS

This way when you create the treemenu the next time, it will contain the same sorting as when saving. This way you infact get both of two worlds, since you get the added alfabetical sorting. (That is, when you pull the data from your database to create the tree, you do not sort anything you just pull from the database the way it was inserted).

Hope this makes sence!

Finally, if I were to use this scripts, I see they are not updated in a while. When you update your suite, do you also update the standalone scripts, or have they become "orphans"?

Kim Steinhaug
Posts: 38
Joined: Wed Oct 26, 2005 12:04 am

Return to Folder tree questions

Who is online

Users browsing this forum: No registered users and 1 guest