Can you refresh the content tree through the API

Jon Tibbetts asked on November 21, 2014 16:01

When I add a page from the back end code. The tree does not automatically refresh. I have to right click and select refresh subsection. Is there a command from the the API to do this?

Correct Answer

Jon Tibbetts answered on November 21, 2014 19:59

So the solution I came up with in my situation, I modified the OnAfterAction method for the EditMenu.ascx.cs file so that if there is a save with a document with a certain classname I force the refreshtree value to true. And then the tree will automatically update.

1 votesVote for this answer Unmark Correct answer

Recent Answers


Martin Danko answered on November 21, 2014 16:42

Hello Jon,

No, the refresh of the content tree is handled via JavaScript, not API.

Best regards, Martin

0 votesVote for this answer Mark as a Correct answer

Jon Tibbetts answered on November 21, 2014 17:44

When inspecting the element for the "refresh" context menu item I see this

`

Refresh subsection
'

Can this script be called from the api through a RegisterStartupScript?

0 votesVote for this answer Mark as a Correct answer

Jon Tibbetts answered on November 21, 2014 17:45

<div id="m_mnodeMenu_contextMenuControl_iRefresh" class="Item" onclick="RefreshTree(GetContextMenuParameter('nodeMenu'), null);">
            <div class="ItemPadding"><span id="m_mnodeMenu_contextMenuControl_l" class="Name">Refresh subsection</span></div>
        </div>
0 votesVote for this answer Mark as a Correct answer

Martin Danko answered on November 21, 2014 17:51

Hello Jon,

But regrettably this method just registers refresh tree script for documents UI. It doesn't execute any action.

Best regards, Martin

0 votesVote for this answer Mark as a Correct answer

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