Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

APEX Widget TreeView. Add a node in a particular position

PabloBocchio-OracleSep 14 2016 — edited Sep 29 2016

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

This post has been answered by PabloBocchio-Oracle on Sep 28 2016
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 26 2016
Added on Sep 14 2016
1 comment
1,379 views