Total Pageviews

In Oracle apex 20.2, What is the javascript to get the selected tree node id

Here's how (based on Scott's EMP table).

Suppose it is page 70 which contains the tree region. Create a page item on it (for example, P70_EMPNO).

The tree query looks like this (pay attention to the link column; once clicked, it stores the selected node value into the P70_EMPNO page item):

select 
case when connect_by_isleaf = 1 then 0 when level = 1 then 1 else -1 end as status, 
level, 
ename || ' (' || empno ||')' as title, 
'icon-tree-folder' as icon, 
empno as value, 
ename as tooltip,
-- 
'javascript:$s(''P70_EMPNO'', '''||EMPNO||''')' as link --> this 
from emp 
start with mgr is null 
connect by prior empno = mgr 
order siblings by ename;

The result (when you click on the JAMES node):



No comments:

Post a Comment

ORA-00845: MEMORY_TARGET not supported on this system

 The shared memory file system should have enough space to accommodate the MEMORY_TARGET and MEMORY_MAX_TARGET values. To verify: SQL> sh...