How to pick node of Multi-Node-Tree-Picker using javascript only ?
Hello,
I'm working on umbraco v 4.7.1.1 backoffice, and i'm tring to develop a script using only javascript.
Currently, I have a "Multi-Node-Tree-Picker" tree with a lot of nodes, each with unique id. I wish to understand how can I use javascript, to emulate the picking process of a node. (that "process" is the regular left click with the mouse on a node )
In addition please note:
I can't change anything within the umbraco system and files.( i'm not the admin and don't have premissions to change anything )
Thus, I wish to run this command/script using chrome's built-in java console and/or greasymonkey addon.
On old version of Umbraco, I could use the following command to do that: parent.right.nameOfaObjectOrClassDunno.TreeNodeClick(1111); (the "1111" is the id of some node) In the current version - this method of "picking" a node, does not exist anymore ! The code of every node under the tree looks like this:
<li id="1111" class="uc-treenode-click loaded leaf" rel="dataNode" umb:type="FilteredContentTree"><a href="javascript:openContent('1111');" style="background-image:url("/umbraco/images/umbraco/settingTemplate.gif");" class=" sprTree noSpr" umb:nodedata="{'menu':'','nodeType':'FilteredContentTree','source':'/umbraco/tree.aspx?rnd=e11111cfe9bd4edb911a222a333333ae&id=1111&treeType=FilteredContentTree&contextMenu=false&isDialog=true&dialogMode=id&nodeKey=1000'}"><div>the content of this node which graphicly I see</div></a></li>
How can I "pick" that node and add it to the picked list, using only javascript commands ?
Please advise,
thanks,
Frank.
If you just use .click() on the node that you want to select it should work, but it will only show the node on the right part of MNTP at the selected nodes. If you don't have any permissions to change anything you can't save it.
As you can understand - I don't understand Umbraco at all - I'm an amateur java programmer.
The lack of "admin" privileges means that I don't have any control on umbraco as developer... I only have access as a backoffice user, that only enter content to the site I work on. I have enough privileges to pick with the mouse a node from the MNTP tree and add it to "the right side", and enough privileges to save that pick. I want to make my work on umbraco more efficient, thus the need to understand how to approach MNTP through javascript.
In the previous version of umbraco I could run a javascript command to pick a really deep level node from the MNTP, using only 1 command. ( as I wrote already). My problem with your suggestion is that I literally need to open the branches of the tree inorder to run the ".click()" command on a node. ( becuase if the tree is not cascaded - the node's code does not exist in the html code )
I wish to "pick" an internal node from specific MNTP ( there are few ), and to move it to the "picked node area on the right" - without the need to open X branches before I see the node. Maybe there a way for me to declare a new object, which then "gets" the specific MNTP that I wish to control ? ( but how? what class is that? ) It could really help me if you could write a javascripted example.
How to pick node of Multi-Node-Tree-Picker using javascript only ?
Hello,
I'm working on umbraco v 4.7.1.1 backoffice, and i'm tring to develop a script using only javascript.
Currently, I have a "Multi-Node-Tree-Picker" tree with a lot of nodes, each with unique id.
I wish to understand how can I use javascript, to emulate the picking process of a node.
(that "process" is the regular left click with the mouse on a node )
In addition please note:
On old version of Umbraco, I could use the following command to do that:
parent.right.nameOfaObjectOrClassDunno.TreeNodeClick(1111);
(the "1111" is the id of some node)
In the current version - this method of "picking" a node, does not exist anymore !
The code of every node under the tree looks like this:
<li id="1111" class="uc-treenode-click loaded leaf" rel="dataNode" umb:type="FilteredContentTree"><a href="javascript:openContent('1111');" style="background-image:url("/umbraco/images/umbraco/settingTemplate.gif");" class=" sprTree noSpr" umb:nodedata="{'menu':'','nodeType':'FilteredContentTree','source':'/umbraco/tree.aspx?rnd=e11111cfe9bd4edb911a222a333333ae&id=1111&treeType=FilteredContentTree&contextMenu=false&isDialog=true&dialogMode=id&nodeKey=1000'}"><div>the content of this node which graphicly I see</div></a></li>
How can I "pick" that node and add it to the picked list, using only javascript commands ? Please advise, thanks, Frank.
If you just use .click() on the node that you want to select it should work, but it will only show the node on the right part of MNTP at the selected nodes. If you don't have any permissions to change anything you can't save it.
Jeroen
Jeroen - Thnx for the reply.
As you can understand - I don't understand Umbraco at all - I'm an amateur java programmer.
The lack of "admin" privileges means that I don't have any control on umbraco as developer...
I only have access as a backoffice user, that only enter content to the site I work on.
I have enough privileges to pick with the mouse a node from the MNTP tree and add it to "the right side", and enough privileges to save that pick.
I want to make my work on umbraco more efficient, thus the need to understand how to approach MNTP through javascript.
In the previous version of umbraco I could run a javascript command to pick a really deep level node from the MNTP, using only 1 command. ( as I wrote already).
My problem with your suggestion is that I literally need to open the branches of the tree inorder to run the ".click()" command on a node.
( becuase if the tree is not cascaded - the node's code does not exist in the html code )
I wish to "pick" an internal node from specific MNTP ( there are few ), and to move it to the "picked node area on the right" - without the need to open X branches before I see the node.
Maybe there a way for me to declare a new object, which then "gets" the specific MNTP that I wish to control ? ( but how? what class is that? )
It could really help me if you could write a javascripted example.
Thanks again !
is working on a reply...