Getting the node id from in custom tree event / IAction
I'll get my excuses in first... I have a bit of a cold today so I'm probably missing something really obvious, and I'm sure this question has been asked many times before, but...
From my custom tree event and the IAction class it calls, how do I pass the node id of the node that's been right-clicked on, to my aspx page?
I'm using Umbraco 4.7.1.1 and I've followed the umbraco support videos to get this far, but now I'm a bit stuck.
The menu item appears when I right-click on my node in the umbraco content tree, and if I select the item, a modal window appears displaying my page "packageCaseStudy.aspx?id=1", but I need to replace the 1 with the node id the user right-clicked on. If anyone can help, that would be great.
NOTE - in the code below, the class is called "PackageCaseStudy". This isn't a reference to umbraco packages, it's just what my client calls the action I'm trying to perform.
Getting the node id from in custom tree event / IAction
I'll get my excuses in first... I have a bit of a cold today so I'm probably missing something really obvious, and I'm sure this question has been asked many times before, but...
From my custom tree event and the IAction class it calls, how do I pass the node id of the node that's been right-clicked on, to my aspx page?
I'm using Umbraco 4.7.1.1 and I've followed the umbraco support videos to get this far, but now I'm a bit stuck.
The menu item appears when I right-click on my node in the umbraco content tree, and if I select the item, a modal window appears displaying my page "packageCaseStudy.aspx?id=1", but I need to replace the 1 with the node id the user right-clicked on. If anyone can help, that would be great.
NOTE - in the code below, the class is called "PackageCaseStudy". This isn't a reference to umbraco packages, it's just what my client calls the action I'm trying to perform.
Still struggling with this but I'm sure there's a simple answer.
Hi. You can use "UmbClientMgr.mainTree().getActionNode()" inside the javascript that handles your action.
Update: It returns a javascript object - in order to get the ID just get the "nodeId" property of it: "UmbClientMgr.mainTree().getActionNode().nodeId"
That worked like a charm. Absolutely brilliant.
Thanks Rodion!
is working on a reply...