Hello,
I have an application in APEX 5.0.1.00.06 and I'm using the widget.treeView.js to add, update or remove nodes from a tree.
I want to add a node in a particular position but I don't know how to do it.
The application has the following items associated with the tree node's attributes:
ITEMS IN FORM Tree Node Attribute
P8_ID id
P8_DISPLAY_NAME label
P8_DISPLAY_ORDER ?
In P8_DISPLAY_ORDER, I set the position of the node using a multiple of ten such as the APEX Page Designer do it.
If I'm adding a node with P8_DISPLAY_ORDER = 30, I want the node inserted appears in the third position but it didn't happen.
I tried with P8_DISPLAY_ORDER = 30 and P8_DISPLAY_ORDER = 40, and always the tree added the node in the first position under the correct parent node.
I tried setting position$ = 0, =2, =3 and in all the cases, the tree adds the node in the 1st position under the correct parent node.
Can someone help me to adding nodes in a certain position or move a node from a position to other?
This is my code:
var myTree$ = $("#myTree");
var sel$ = myTree$.treeView("getSelection").first();
var position$ = $v(P8_DISPLAY_ORDER)/10-1;
var newNode = {
id: $v(P8_ID),
label: $v(P8_DISPLAY_NAME)
};
myTree$.treeView("addNode", sel$, position$, newNode);
Thanks!
Pablo