Copied to clipboard

Flag this post as spam?

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


  • thethinkimmexican 3 posts 23 karma points
    Jun 11, 2012 @ 18:45
    thethinkimmexican
    0

    wrong menu action being shown on tree node

    i am trying to set up a custom create action for the root node on 2 different admin sections, coordinators and events.

    i have set up classes that inherit IAction and essentially behave exactly the same except they return different javascript:

    public class ActionCreateCoordinator : IAction

    return @"function createCoordinator() { parent.right.document.location.href = 'plox/coordinator.aspx'; }";

    public class ActionCreateEvent : IAction

    return @"function createIntervention() { parent.right.document.location.href = 'plox/events.aspx'; }";

    the problem is that when i add these classes to the menu like so:

    rootNode.Menu.Clear();           

    rootNode.Menu.AddRange(new System.Collections.Generic.List<IAction> {
                        ActionCreateCoordinator.Instance,
                        ContextMenuSeperator.Instance,
                        ActionRefresh.Instance });

    and:

    rootNode.Menu.Clear();           

    rootNode.Menu.AddRange(new System.Collections.Generic.List<IAction> {
                        ActionCreateEvent.Instance,
                        ContextMenuSeperator.Instance,
                        ActionRefresh.Instance });

    there is the problem that within the admin section the same action is shown on both seperate trees. i have ran through the code in debug and it is adding the correct actions to the rootnode.menu but when i right click on the root node within the admin area it's always the Create Event action that is available.

    Anyone able to help?

Please Sign in or register to post replies

Write your reply to:

Draft