Copied to clipboard

Flag this post as spam?

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


  • Dennis Milandt 190 posts 517 karma points
    Mar 21, 2009 @ 20:08
    Dennis Milandt
    0

    How to reload the content tree?

    I have created a dashboard control which can create a content item. I would like to reload the content tree after creating this item.

    How do I reload the content tree for a specific node while keeping the same item selected?

    Or - what options are there to reload the content tree?

    Kind regards
    Dennis Milandt

  • Piquet 14 posts 21 karma points
    Mar 22, 2009 @ 05:42
    Piquet
    0

    Not sure how it would go with the dashboard, but when I do it via an actionhandler in V4 I use
    library.UpdateDocumentCache(documentObject.Id);
    library.RefreshContent();

    Solves if for me.

  • Dennis Milandt 190 posts 517 karma points
    Mar 22, 2009 @ 15:42
    Dennis Milandt
    0

    Thank you very much - I will try that.

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Mar 22, 2009 @ 15:50
    Dirk De Grave
    0

    Hi,

    [quote]Not sure how it would go with the dashboard, but when I do it via an actionhandler in V4 I use
    library.UpdateDocumentCache(documentObject.Id);
    library.RefreshContent();[/quote]

    I'd not use library.UpdateDocumentCache() when creating the item because UpdateDocumentCache will publish the document as well... If you'd like to publish in a single operation, then leave it there.

    Regards,
    /Dirk

  • Dennis Milandt 190 posts 517 karma points
    Mar 22, 2009 @ 16:14
    Dennis Milandt
    0

    Neither library.UpdateDocumentCache(documentObject.Id) nor library.RefreshContent() seems to reload the content tree - at least not when called from a dashboard control.

    Perhaps there is some JavaScript function which can be called to trigger the Content Tree to reload.

  • Richard Soeteman 4046 posts 12899 karma points MVP 2x
    Mar 23, 2009 @ 08:58
    Richard Soeteman
    1

    Hi Have not tested this, but try [code]parent.node.reload();[/code] in your Javascript function.

    Cheers,

    Richard

  • Dennis Milandt 190 posts 517 karma points
    Mar 23, 2009 @ 09:13
    Dennis Milandt
    0

    So, reloading the frame containing the Content Tree using JavaScript?

    If I do that in firefox just using Right click -> This frame -> Reload frame, the Content Tree reloads all right, but it does not expand down to the node I currently have open.

    In fact it isn't a dashboard control I am using, but a datatype control from which I have placed some code to create a child item. What I want to do with this reload is to update the Content Tree so it knows that current item now contains children.

    So, for a dashboard control your suggestion would actually do the trick, if it wouldn't be required to set focus on a specific item.

  • Jeroen Breuer 4908 posts 12265 karma points MVP 5x admin c-trib
    Apr 20, 2009 @ 12:13
    Jeroen Breuer
    0

    I am trying to do the same thing. I want to reload the content tree after I created a new node with a datatype. In the umbraco source code I found the following javascript:

    [code]
    function refreshNode() {

    if (nodeKey != '') {
    if (tree.webFXTreeHandler.all[nodeKey]) {
    tree.webFXTreeHandler.all[nodeKey].src =
    tree.webFXTreeHandler.all[nodeKey].src + '&rnd=' + Math.random() * 10;

    if (tree.webFXTreeHandler.all[nodeKey].parentNode) {
    // Hvis punktet er lukket, skal det åbnes
    if (tree.webFXTreeHandler.all[nodeKey].childNodes.length > 0) {
    if (!tree.webFXTreeHandler.all[nodeKey].open)
    tree.webFXTreeHandler.all[nodeKey].expand();
    tree.webFXTreeHandler.all[nodeKey].reload();
    treeEdited = true;
    }
    } else {
    tree.document.location.href = tree.document.location.href;
    }
    }
    }
    }
    [/code]

    Should this work and how can I call this javascript method from my code behind?

  • Delete me 45 posts 66 karma points
    May 17, 2010 @ 22:58
    Delete me
    0

     

     

Please Sign in or register to post replies

Write your reply to:

Draft