Copied to clipboard

Flag this post as spam?

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


  • Marco Teodoro 74 posts 149 karma points c-trib
    Jun 18, 2018 @ 10:46
    Marco Teodoro
    0

    How to expand tree view item using angular navigation service - showTree(sectionAlias, syncArgs)?

    Hi i've a angular custom section where i'm using the navigation service to refresh the tree view item after making changes on my custom object.

    But if i hope the node using the url the treeview does't expand to show the related node. i guess i need to use the showTree(sectionAlias, syncArgs) from the navigationService but i don't know what parametters should i send.

    section alias i know it's my own alias for the custom section. but what params should i use to expand the node on the treeview?

  • Dave Woestenborghs 3504 posts 12135 karma points MVP 9x admin c-trib
    Jun 18, 2018 @ 11:10
    Dave Woestenborghs
    100

    Hi Marco,

    Here you can see an example from my tour editor package : https://github.com/dawoe/umbraco-tour-editor/blob/develop/Source/Our.Umbraco.TourEditor/Web/App_Plugins/TourEditor/scripts/controllers/edit-file-controller.js#L146

    And this is from umbraco core (the new dictionary in angular in 7.11) https://github.com/umbraco/Umbraco-CMS/blob/dev-v7/src/Umbraco.Web.UI.Client/src/views/dictionary/dictionary.edit.controller.js#L65

    And here you can find the docs about the navigationService : https://our.umbraco.org/apidocs/ui/#/api/umbraco.services.navigationService

    If you have any questions. Just shoot.

    Dave

  • Marco Teodoro 74 posts 149 karma points c-trib
    Jun 18, 2018 @ 11:43
    Marco Teodoro
    0

    Hi Dave,

    I'm already using the navigationService.syncTree but that does't expand the tree view node. just reload/refresh it. my question is how to expand the node from angular. Because if i open the node with the url instead of navigating over the tree view the editor is presented but the tree view does't show the active node. did i make it clear now? or i'm i missing something about the use of syncTree method?

  • Dave Woestenborghs 3504 posts 12135 karma points MVP 9x admin c-trib
    Jun 18, 2018 @ 11:53
    Dave Woestenborghs
    0

    Hi Marco,

    Can you show some code ?

    Dave

  • Marco Teodoro 74 posts 149 karma points c-trib
    Jun 18, 2018 @ 12:51
    Marco Teodoro
    0

    Hi Dave.

    The init function just loads data from server to bind the viewmodel. enter image description here

    enter image description here

    The place where i'm using the syncTree method is on save. after changing the model data and persist it on db. the sync is ok since the name object name is changed and i can see the treeview node updated with the new object name. what i need is when i open the editor using a full url www.domain.com/#umbraco/section/tree/id is to add some code on the init function to expand the tree view to show the current node.

  • Dave Woestenborghs 3504 posts 12135 karma points MVP 9x admin c-trib
    Jun 18, 2018 @ 13:04
    Dave Woestenborghs
    0

    Hi Marco,

    You can also use the syncTree method in your onInit method.

    That should fix it.

    Dave

  • Marco Teodoro 74 posts 149 karma points c-trib
    Jun 18, 2018 @ 13:36
    Marco Teodoro
    0

    Thanks dave. it works.

  • 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