However.. it seems like RenderJS for my custom tree-node wont fire, and there for there is no javascript rendered to the "DOM" and there for I cant use my custom node...
It shows up perfectly fine, the problem is once I press the node i get an error telling me that openUDevSync isnt found.
any ideas?
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Web; using System.Xml; using umbraco.BusinessLogic.Actions; using umbraco.cms.businesslogic.language; using umbraco.cms.presentation.Trees; using umbraco.interfaces; using Umbraco.Core; using Umbraco.Web.Trees; namespace UDev.Core.Trees { [Tree(Constants.Applications.Developer, "uDev", "UDev")] public class UDevTree : BaseTree { public UDevTree(string application) : base(application) { } protected override void CreateRootNode(ref XmlTreeNode rootNode) { rootNode.NodeType = "uDev"; rootNode.NodeID = "init"; rootNode.Menu = null; rootNode.Text = "UDev"; } public override void Render(ref XmlTree tree) { XmlTreeNode xNode = XmlTreeNode.Create(this); xNode.NodeID = "uDevSdt"; xNode.Text = "Sync document types"; xNode.Action = "javascript:openUDevSync();"; xNode.Icon = "icon-sync"; xNode.OpenIcon = "icon-sync"; xNode.Menu = null; tree.Add(xNode); } public override void RenderJS(ref System.Text.StringBuilder Javascript) { Javascript.Append( @" function openUDevSync() { alert(); }"); } } }
And for the record.. this post-editor gets really crazy if you copy paste code from a vs2013 with the dark-theme.. please fix that..
Thanks for these links. I'm able to get my custom section and menu to display in Umbraco 7, but is there anyway to use a custom Controller and View? It's hard to tell from the example. Thanks.
Custom tree, RenderJS never triggered...
Hi!
Just updated my code from 7.0.2 to 7.0.3
However.. it seems like RenderJS for my custom tree-node wont fire, and there for there is no javascript rendered to the "DOM" and there for I cant use my custom node...
It shows up perfectly fine, the problem is once I press the node i get an error telling me that openUDevSync isnt found.
any ideas?
And for the record.. this post-editor gets really crazy if you copy paste code from a vs2013 with the dark-theme.. please fix that..
Thanks in advance!
necroing this post, but i'm having the same issue. When I set a breakpoint in RenderJS, it never gets hit.
Hi kris
What version of Umbraco are you seeing this on? Same as the original poster?
/Jan
I'm on Umbraco version 7.2.1 assembly: 1.0.5462.37503
This code is the legacy version of creating custom trees (pre v7). Since V7 you can inherit from TreeController.
Have a look here for a example : https://bitbucket.org/dawoe/umbukfestival2014
Dave
Hi Kris,
here is another good example:
http://www.nibble.be/?p=440
Best,
Sören
Thanks for these links. I'm able to get my custom section and menu to display in Umbraco 7, but is there anyway to use a custom Controller and View? It's hard to tell from the example. Thanks.
is working on a reply...