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
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.
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.
Seem like I should be working with the umbClientManager instead. Does anyone know where I can find more info about this?
Never mind, i got my anwser in a nother thred.
http://our.umbraco.org/forum/developers/extending-umbraco/13094-Where-is-UmbClientMgr-?p=0#comment48262
is working on a reply...