Copied to clipboard

Flag this post as spam?

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


  • John 88 posts 112 karma points
    Apr 21, 2011 @ 10:29
    John
    0

    Refresh Content Tree

    Hi, I've got a custom data type which ads nodes under a parent (a gallery with multiple uploads of gallery images). This all works fine but I want to refresh the content tree (specifically the gallery content nodes children) to display the newly added nodes under the current parent (the current parent would be the gallery node - it's already selected).

    I've tried:

    UmbClientMgr.mainTree().reloadActionNode(false, true, null);

    but it seems to collapse the whole content tree. Any thoughts?

     

    Cheers

  • Jeroen Breuer 4861 posts 12138 karma points MVP 3x admin c-trib
    Apr 21, 2011 @ 11:43
    Jeroen Breuer
    1

    Hello,

    You can try:

    BasePage.Current.ClientTools.SyncTree(path, true);

    Or

    BasePage.Current.ClientTools.ChildNodeCreated();

    Jeroen

  • John 88 posts 112 karma points
    Apr 21, 2011 @ 13:47
    John
    0

    Thanks Jeroen burt they're methods to be called in the backend, yes? I'm after javascript functions.

  • Tom Fulton 2030 posts 4996 karma points c-trib
    Apr 21, 2011 @ 14:23
    Tom Fulton
    0

    Hi John,

    They are methods to be called in the backend, however they're just wrappers for the Javascript functions - so there should be a corresponding Javascript method, something like UmbClientMgr.mainTree().syncTree('path..',true);

    -Tom

  • John 88 posts 112 karma points
    Apr 21, 2011 @ 14:26
    John
    0

    Path being the URL to the content? The URL to the content edit page?

  • Tom Fulton 2030 posts 4996 karma points c-trib
    Apr 21, 2011 @ 14:28
    Tom Fulton
    0

    It's the .Path property of a Document, which I believe returns something like -1,1111,1112 to indicate it's path in the tree

  • John 88 posts 112 karma points
    Apr 21, 2011 @ 14:30
    John
    0

    Ooooooh. Understood, I'll give that a burl.

    Thanks so much. I'll report back on the result.

  • John 88 posts 112 karma points
    Apr 21, 2011 @ 15:30
    John
    0

    Ok, that does indeed refresh the parent node in the tree BUT it also collapses it. So do you also know the JS function to open the tree of children?

  • John 88 posts 112 karma points
    Apr 21, 2011 @ 16:31
    John
    3

    In the end, I don't know of another way, I just raised the click event on the parent node LI container same as a user might, like so my method basically has 2 calls within it - for example:

    UmbClientMgr.mainTree().syncTree('-1,1102,1103',true); // AJAX refresh of the node

    UmbClientMgr.mainWindow().jQuery(".umbTree #1103").click(); // opens the node tree visibly

     

    Thanks for everyones help

  • Tim 1193 posts 2655 karma points c-trib
    Apr 21, 2011 @ 17:22
    Tim
    0

    Aha, now that is interesting, I might be able to use that to solve a problem I'd previously got round using server side reloads to re-open the tree! I shall have a play, thanks for posting your findings!

    :)

  • John 88 posts 112 karma points
    Apr 22, 2011 @ 03:14
    John
    0

    :)

    Also, FYI, I added the speech bubble display also with:

    UmbClientMgr.mainWindow().UmbSpeechBubble.ShowMessage('<%= umbraco.BasePages.BasePage.speechBubbleIcon.save %>', 'Saved', 'The files have been uploaded');

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies