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!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Populate a JQuery Treeview using a PL/SQL procedure

Yann39May 21 2010 — edited Mar 24 2011
Hi,

as we have a lot of problems with original apex trees, we decided to build our own tree using the jQuery Treeview Plugin.
We want to populate the tree by executing an OnDemand Application Process, which would return the HTML hierarchy like :
<ul id="browser" class="filetree">
&nbsp;<li><span class="folder">Folder 1</span>
&nbsp;&nbsp;<ul>
&nbsp;&nbsp;&nbsp;<li><span class="file">Item 1.1</span></li>
&nbsp;&nbsp;</ul>
&nbsp;</li>
&nbsp;<li><span class="folder">Folder 2</span>
&nbsp;&nbsp;<ul>
&nbsp;&nbsp;&nbsp;<li><span class="folder">Subfolder 2.1</span>
&nbsp;&nbsp;&nbsp;&nbsp;<ul id="folder21">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<li><span class="file">File 2.1.1</span></li>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<li><span class="file">File 2.1.2</span></li>
&nbsp;&nbsp;&nbsp;&nbsp;</ul>
&nbsp;&nbsp;&nbsp;</li>
&nbsp;&nbsp;&nbsp;<li><span class="file">File 2.2</span></li>
&nbsp;&nbsp;</ul>
&nbsp;</li>
</ul>
I just started coding the ODP :
DECLARE    

CURSOR cur IS
select 
  op_descript, 
  op_id, 
  op_parent_op_id, 
  level
from operations
connect by prior op_id = op_parent_op_id
start with op_id = 0;    

BEGIN
	htp.p('<ul id="browser" class="filetree">');
	FOR c IN cur LOOP
		/* etc... */
	end loop;
END;
As the content of the loop seems a little complicated, and as I don't want to reinvent the wheel, I ask you if you think of an other way to populate the tree, or if one of you have already tried a similar thing.

Thanks !

Yann.
This post has been answered by peter_raganitsch on May 25 2010
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 21 2011
Added on May 21 2010
14 comments
2,687 views