Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Nikola Petkovic 64 posts 63 karma points
    Jun 23, 2009 @ 10:00
    Nikola Petkovic
    0

    How to properly change the name of a tree node in a custom tree?

    Hi all,

    I made my custom tree and it works perfectly. I'll explain the only issue I'm hitting:

    My custom tree is just a subtree of umbraco Content tree. I wanted to display different name for some node than the original one, so I just changed the text property of a node (xNode.Text = "Custom_Name") and it displays fine.
    The problem is that after selecting (clicking) that particular node, it's name changes back to the original one as it is in Content tree.

    Any idea how to change the name so it doesnt get back...?

    Cheers!

    Nikola

  • Shannon Deminick 1526 posts 5272 karma points MVP 3x
    Jun 29, 2009 @ 23:13
    Shannon Deminick
    0

    You mean you want to rename the root node, normally called 'content' to 'Custom_name'...?

    The root node name for all trees is taken from the database umbracoAppTree alias depending on how many trees are being loaded in to the app.

  • Nikola Petkovic 64 posts 63 karma points
    Jun 30, 2009 @ 15:04
    Nikola Petkovic
    0

    Hi Shannon,

    Actually I want to be able to display different name for any other node in the tree (root node is fine).
    As I said above, I succeeded to to rename them, but after I select a node in the tree, the name gets back to original node name (as it is in Content tree).

    Regards,
    Nikola

  • Shannon Deminick 1526 posts 5272 karma points MVP 3x
    Jul 02, 2009 @ 01:51
    Shannon Deminick
    0

    So to get this straight, you've inherited from the loadContent tree and swapped out the loadContent tree for your new custom tree class in the umbracoAppTree table... It renders the nodes out correctly, but when you click on a node, the node text changes to what would have been originally rendered in the loadContent tree?

    ...  Not sure if i fully understand. Is the above statement correct?

  • Nikola Petkovic 64 posts 63 karma points
    Jul 02, 2009 @ 14:03
    Nikola Petkovic
    0

    You got it right.

    Except, I inherited from BaseTree instead from loadContent tree, so I get content nodes by

    Document[] nodes = Document.GetChildrenForTree(root_id);

    and then set their names manually.

  • Shannon Deminick 1526 posts 5272 karma points MVP 3x
    Jul 04, 2009 @ 04:50
    Shannon Deminick
    0

    Ahh, ok. How are you setting the node's source property? Perhaps, the ajax request for the child nodes once your initial tree is loaded is querying for nodes from loadContent tree instead of your tree....

    When you say you click on the node and the name changes, is that because when you click on the node the current tree branch refreshes?

  • Nikola Petkovic 64 posts 63 karma points
    Jul 07, 2009 @ 12:06
    Nikola Petkovic
    0

    Actually I am not sure if the whole tree branch "refreshes", but it certainly does not behave as when its reloaded by clicking "Reload nodes" action (so you a dial clock is displayed)

    I think that its just the tree node that is somehow being "refreshed" so its name changes.

Please Sign in or register to post replies

Write your reply to:

Draft