Refresh content tree from custom UI tab in Pages module

Tom Troughton asked on June 30, 2016 12:02

I have added a custom UI element which appears as an additional Propterties tab within the Pages module.

Functionality on my custom tab affects the content tree so I'm trying to find a way to refresh the content tree on the left of the Pages module from a tab on the right.

Looking through similar Kentico pages, it looked like adding the following to my code behind might work, but it doesn't seem to. Any ideas?

string script = "if(window.FramesRefresh){FramesRefresh(true, " + Node.NodeID + ");}";
ScriptHelper.RegisterStartupScript(this, typeof(string), "refreshAction", ScriptHelper.GetScript(script));

Correct Answer

Anton Grekhovodov answered on July 1, 2016 07:55

Hi Nat,

ScripHelper class has RefreshTree method, try to use it in your code.

Example: RefreshTree

1 votesVote for this answer Unmark Correct answer

Recent Answers


Dawid Jachnik answered on June 30, 2016 12:09

Hello Nat,

I think it's not achievable from this place. You need to perform the same action like the hidden refresh button which runs the javascript

TreeRefresh();

method. Try to access to tree frame somehow.

1 votesVote for this answer Mark as a Correct answer

Tom Troughton answered on July 1, 2016 19:03

Thank you Anton, works perfectly :)

0 votesVote for this answer Mark as a Correct answer

Anton Grekhovodov answered on July 2, 2016 15:43

You're welcome)

0 votesVote for this answer Mark as a Correct answer

Dave Forster answered on November 29, 2016 11:41

Hi, just came across this question as I have a similar requirement.

I have a custom form control which has a button allowing users to do a Quick Archive (which effectively moves the content page into an archive folder). I have been able to successfully refresh the tree using this method but I also need to be able to refresh the form page so it picks up certain other changes related to the operation (such as visibility of other fields etc). Currently I have to manually reload the form tab after the page is moved.

Is there a method that will do both a tree refresh and a form tab refresh ?

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.