Copied to clipboard

Flag this post as spam?

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


  • Robert Mulder 79 posts 272 karma points c-trib
    Mar 18, 2014 @ 10:38
    Robert Mulder
    0

    TreeView menu action that changes available menu actions

    In our application we have items in a treeview that can be blocked and unblocked. This action can be triggered using the context menu. Now it's easy enough to add the context menu for either in the TreeController's GetMenuForNode() method, but how do I make it change to the other once one option has been used.

    I have a javascript function that sits behind the confirm button for either action. What I need to do now is:

    1. Refresh the treenode to have a different icon
    2. Refresh the main content to show the status behind the 'status' label
    3. Refresh the possible actions to now include either Block or Unblock depending on the action that was just used.

    I can use the following javascript to update the icon: treeService.reloadNode($scope.currentNode);

    But how do I update the main content? The javascript controller that calls the API method on the server is attached to the confirm-block.html template of the action menu. The $scope available here does not provide access to the content of the main area.

    Finally, how can I cause the menu actions to refresh. I would've thought that reloading the treenode would also cause the actions associated with that tree node to be refreshed as well. This does not seem to be the case.

Please Sign in or register to post replies

Write your reply to:

Draft