Copied to clipboard

Flag this post as spam?

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


  • Hendy Racher 863 posts 3849 karma points MVP 2x admin c-trib
    Aug 30, 2010 @ 20:34
    Hendy Racher
    0

    Select / update a tree node via UmbClientMgr / ClientTools ?

    Hi,

    In a custom tree, after editing the name of a node and then saving, I'd like to be able to refesh the tree to reflect this change. I've tried:

    BasePage.Current.ClientTools.RefreshTree("treeAlias");

    and that works, but the visually slected node in the tree then moves to the tree root. Is there a way of just refeshing the current node ?

    TIA,

    Hendy

  • chappers 18 posts 36 karma points
    Oct 13, 2010 @ 17:36
    chappers
    0

    Hi Hendy,

    I think this might be the way:

    ((BasePage)Page).ClientTools.SyncTree("path", true);

    Just testing on my Umbraco custom section but having trouble working out what I need for path part in a custom section.

     

     

     

  • chappers 18 posts 36 karma points
    Oct 13, 2010 @ 18:15
    chappers
    0

    UPDATE:

    This does work you have to specify the path using something like:

    "-1,1,1" etc - depending how many levels deep your tree is.

    In my custom sections tree I used:

    ((BasePage)Page).ClientTools.SyncTree("-1," + PropertyId + "," + SpaceId, true);

     

    I found this which helped show how it works underneath:

    http://www.java2s.com/Open-Source/CSharp/Content-Management-Systems-CMS/umbraco/umbraco/BasePages/ClientTools.cs.htm

    Then looked at Generated source to see what jTree was outputting in my scenario.

    Each "li" has Id which is what I think corresponds to the path you build above.

     

    Hope that helps


    Chris

     

     

Please Sign in or register to post replies

Write your reply to:

Draft