Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Aug 2004
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Need to Take a List of Strings add to array, then tree-it

    I have a list of folders generated by a server side loop, it outputs in the following format:.

    <script>kcAddToArray(,'Inbox');</script>
    <script>kcAddToArray('Drafts');</script>
    <script>kcAddToArray('Sent');</script>
    <script>kcAddToArray('Sent Items');</script>
    <script>kcAddToArray('Spam');</script>
    <script>kcAddToArray('Test Folder');</script>
    <script>kcAddToArray('Test Folder/SubLevel -1');</script>
    <script>kcAddToArray('Test Folder/SubLevel -1/SubSubLevel -1');</script>
    <script>kcAddToArray('Test Folder/SubLevel -2');</script>
    <script>kcAddToArray('Trash');</script>

    What I need to do is:
    A) Figure out how to take each folder and add them to a common array.
    B) Put them in some kind of NON-COLLAPSING tree (example follows).

    USERNAME <--Added Elsewhere
    |_Inbox
    |_Drafts
    |_Sent
    |_Sent Items
    |_Spam
    |_Test Folder
    | |_SubLevel -1
    | | |_SubSubLevel -1
    | |_SubLevel -2
    |_Trash

    C) Now for the biggie, it needs to support an infinite number of sub folders.

    I would be gratefully appreciative for any assistance provided.


    What I have been doing, is very different from how I would like it to be, This only work partway and not very well:

    function kcTreeIt(kcDisplay)
    {
    kcLevel = kcDisplay.split("/");
    var kcString = "";
    var i;
    for(i = 0; i <= kcLevel.length - 1; i ++)
    {
    if (i <= kcLevel.length - 2)
    {
    if (kcLevel.length > 0)
    {
    if (i >= 1)
    {
    kcString = kcString + "<img src='/nwimg/mail/KellCOMnet/gui/folderlist/fld_blank.png'>";
    }
    else
    {
    kcString = kcString + "<img src='/nwimg/mail/KellCOMnet/gui/folderlist/fld_left.png'>";
    }
    }
    }
    else
    {
    kcString = kcString + "<img src='/nwimg/mail/KellCOMnet/gui/folderlist/fld_sub.png'>";
    }
    }
    kcString = kcString + " <a href=\"||action||\">" + kcLevel[kcLevel.length - 1] + "</a>";

    document.write(kcString);
    }

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    Nashua, NH
    Posts
    1,724
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Have server side generate nested lists (www.vladdy.net/Demos/Tree.html) and go from there...
    Vladdy | KL
    "Working web site is not the one that looks the same on common graphical browsers running on desktop computers, but the one that adequately delivers information regardless of device accessing it"

  • #3
    New to the CF scene
    Join Date
    Aug 2004
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy Re: VLaddy

    Thank You for Your Reply,

    But unfortunately that will not work, because the server side engine will only output the folder name with complete path as in "Root/Folder/SubFolder/SubSubfolder"

    Any display has to be clientside the "kcAddToArray" is hardcoded


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •