Copied to clipboard

Flag this post as spam?

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


  • marthin 87 posts 106 karma points
    Sep 28, 2010 @ 13:28
    marthin
    0

    Upgrade to 4.5 killed context menus

    Hi,

    When i updated to v4.5 from 4.03 i got problems with the Context Menus in my custom section. I have implemented a call to a modal that worked great in 4.03 but now it seems there is some other way to call modals? this is my code

     


            protected override void CreateRootNode(ref XmlTreeNode rootNode)
            {
                rootNode.Icon = FolderIcon;
                rootNode.OpenIcon = FolderIconOpen;
                rootNode.NodeType = "init" + TreeAlias;
                rootNode.NodeID = "init";
            }

            protected override void CreateAllowedActions(ref List<IAction> actions)
            {
                actions.Clear();
                actions.Add(XXX.ContextMenu.ActionNew.Instance);
               
                // Följande 2 skall implementeras
                actions.Add(XXX.ContextMenu.ActionMove.Instance);
                // actions.Add(XXX.ContextMenu.ActionCopy.Instance);

                actions.Add(ContextMenuSeperator.Instance);
                actions.Add(XXX.ContextMenu.ActionDelete.Instance);
                actions.Add(ContextMenuSeperator.Instance);
                actions.Add(ActionRefresh.Instance);
               
               
            }

            public override void Render(ref XmlTree Tree)
            {
               
                // if we are at the top then render the first levels
                if (this.NodeKey == string.Empty)
                {
                    var reader = sqlHelper.ExecuteReader("some sql call")            
                       
                        while (reader.Read())
                        {
                            var xNode = XmlTreeNode.Create(this);
                            xNode.NodeID = reader.Get<int>("id").ToString();
                            xNode.Text = reader.Get<string>("text");
                            xNode.Icon = reader.Get<string>("icon");
                            xNode.OpenIcon = reader.Get<string>("openIcon");
                            xNode.Action = string.Format("javascript:listProducts('{0}')", reader.Get<int>("id").ToString());
                           
                            TreeService treeServ = new TreeService(-1, TreeAlias, ShowContextMenu, IsDialog, DialogMode, app, reader.Get<int>("id").ToString());
                            xNode.Source = reader.Get<int>("subNodes") > 0 ? treeServ.GetServiceUrl() : "";
                            Tree.Add(xNode);                       
                        }

                        reader.Close();
                }

     

    -----------

     

    function ActionProductNew()
    {
        openModal('XXX/XXX_add_product.aspx?id=' + nodeID, 'Create product', 300, 580);
    }

    The context menu calls a Action where i'v updated so that a function in a js-file is called insted of using a inline call in the JSFunctionName so its not that problem.

  • marthin 87 posts 106 karma points
    Sep 28, 2010 @ 14:43
    marthin
    0

    Seem like I should be working with the umbClientManager instead. Does anyone know where I can find more info about this?

     

  • marthin 87 posts 106 karma points
    Sep 28, 2010 @ 16:54
Please Sign in or register to post replies

Write your reply to:

Draft