November Happy Hour will be moved to Thursday December 5th.

Trigger Episerver OnPageEdit to to reload after DOM change

Vote:
 

We are developing several ContentTypes which have some sort of AJAX functionality.

Typical use case:

A user is first presented with a list view rendered after an AJAX call has retrieved some data.

When clicking on one of the list items, the list DOM is replaced with a detail view with help of AJAX and Knockout.

We use some Episerver properties in both the list and the detail views. These properties are typically labels for the data. (Both views are hidden knockout templates in the main Razor view)

What we're experiencing, is that OnPageEdit doesn't work in this use case. It seems as the OnPageEdit Javascript Overlay thingy fires right after the page has loaded, before the AJAX event has completed, and certainly before the detail view is shown.

Hence, when we fetch data with AJAX and present the view afterwards, the properties seem uneditable. Is there any way to force the OnPageEdit Mode to reload with Javascript after a certain event? Eg. AjaxHasLoaded or DetailViewIsShown.

I've found this class http://world.episerver.com/Documentation/Javascript-Library/?documentId=cms/7.5/epi-cms/contentediting/OnPageEditing in the Javascript Library which as a function called setupEditMode which seems spot on, but how do I trigger it? 

#112705
Nov 04, 2014 11:11
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.