Copied to clipboard

Flag this post as spam?

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


  • suzyb 474 posts 932 karma points
    Apr 25, 2012 @ 23:58
    suzyb
    0

    Refresh media tree client side

    I am using the Multiple File upload package which once the upload is complete calls some javascrpt intended to refresh the media tree. The javascript, "parent.top.syncTree" fails however, I believe because it is outdated.

    I am trying to find the updated function to perform the same function. I have tried to use "parent.UmbClientMgr.mainTree().reloadActionNode();" but it doesn't seem to be working.  Does anyone know how I can refresh the current folder in the media tree from the right frame.

    Also is there a way to reload the right frame using javascript but keep the same tab showing.  location.reload() loads the contents tab and I'd like to reload the custom multiple file upload tab to "reset" the flash movie.

  • Jeroen Breuer 4908 posts 12265 karma points MVP 5x admin c-trib
    Apr 26, 2012 @ 12:39
    Jeroen Breuer
    1

    In my custom version of MFU this is fixed: http://our.umbraco.org/projects/website-utilities/multiple-file-upload/bugs/20286-Support-for-custom-Media-Types

    I'm using this code:

    uploadUI.addVariable("completeFunction", "<%= RefreshScript %>;");

    public string RefreshScript { get { return string.Format(ClientTools.Scripts.SyncTree, Path, "true"); } }

    Jeroen

  • suzyb 474 posts 932 karma points
    Apr 26, 2012 @ 13:08
    suzyb
    0

    Thanks.

    Is there any way to refresh it but keep the folder open though.

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

    Sorry don't know how to do that. Haven't seen anything in the ClientTools for that yet.

    Jeroen

  • Sebastiaan Janssen 5060 posts 15522 karma points MVP admin hq
    Sep 05, 2012 @ 06:10
    Sebastiaan Janssen
    3

    I've just pushed a change to 4.9.0 that will allow you to do this, there's a third (optional) parameter to the javascript: supressChildReload. Setting the suppresion to false will open up the tree. So the call would be: UmbClientMgr.mainTree().syncTree(myPath, true, false);

    I couldn't go and change the ClientTools API directly, so as a like hack you can do as Jeroen said above, but with a twist (notice "true, false" being one string):

    return string.Format(ClientTools.Scripts.SyncTree,Path,"true, false");

    See the thing that you're calling is actually a getter with the string formatting params in there:

    public static string SyncTree { get { return GetMainTree + ".syncTree('{0}', {1});"; } }

    So, if {1} is being replaced with "true, false" you can sneak that third parameter in there.

Please Sign in or register to post replies

Write your reply to:

Draft