Copied to clipboard

Flag this post as spam?

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


  • Biagio Paruolo 1621 posts 1914 karma points c-trib
    Sep 12, 2016 @ 05:48
    Biagio Paruolo
    0

    Is there an event handler that trigger when click or open a content node?

    Is there an event handler that trigger when click or open a content node? I need to change some content node info when editor open the node. Thank you.

  • Ian 178 posts 752 karma points
    Sep 12, 2016 @ 20:40
    Ian
    0

    I havent got access to my code but look at this eventsService.emit("appState." + stateObjName + ".changed", { key: key, value: value });

    https://github.com/umbraco/Umbraco-CMS/blob/75c2b07ad3a093b5b65b6ebd45697687c062f62a/src/Umbraco.Web.UI.Client/src/common/services/appstate.service.js.

    In a solution using the nuget version of umbraco this code will be in the umbraco folder i think in the umbraco.services.js. you will inject the eventservice into your controller and, after establishing the exact event triggered by putting a breakpoint on this line and debugging through create an eventsService.on handler for the correct event.

    See the final solution to a similar issue here https://our.umbraco.org/forum/extending-umbraco-and-using-the-api/78841-get-selected-node-when-clicking-angularjs

    If that event does not do exactly the right job, by doing the debugging mentioned you may find another that looks something like nodechanged. Bear in mind however that strictly speaking one of these other events migh also get triggered at other times, not just as a result of clicking the tree node.

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies