> I don't know if i'm following this correctly.
> Your first solution:
> <cfset rstree = querynew("file,parent")>
> <cfset queryaddrow(rstree)>
> <cfset rstree.file[1] = myfilname>
> <cfset rstree.parent[1] =
> getdirectoryfrompath(myfilename)>
> -=------
> <cfset rstree.parent[1] =
> getdirectoryfrompath(myfilename)>
> the getdirectoryfrompath function returns the path that
> the file is currently stored, but i don't see in your
> sample pseudo code where you are passing the pathname
> column field.
> Have I lost it?
> -=------
Sorry, my example was a bit incomplete...
the pathname column would be the "myfilename" variable in this case...
essentially the query (or better yet structure) needs to know two
things - the current node/file name and the directory that node or
file name is in... So in the example above, the query has two columns,
"file" and "parent" which might just as well be "parent" and "child".
How you populate that query is entirely up to you at that point,
although I've found in my own development that it seems easier to
create trees using structures than it is using queries... the
recursive function then would accept the structure as an argument and
the name of the node in question as another argument. It uses the name
to find the current node in the structure (which is another structure
representing your dhtml tree) and then attaches the current node to
the parent node by calling itself with the same structure and the name
of the parent node. If you didn't have to worry about empty
directories, I'd say you could just attach each node to its parent and
not worry about the recursiveness because using a structure would take
care of that for you, or perhaps you can do it that way and then
simply not display any folder elements which don't contain any
children in their child arrays.
Sorry this is probably all still pretty garbled. I really am
exhausted.
s. isaac dealey 954.927.5117
new epoch : isn't it time for a change?
add features without fixtures with
the onTap open source framework
http://www.sys-con.com/story/?storyid=44477&DE=1
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

