The following Javascript code used when initializing the tree region to colorize the tree node texts.
function( options ) {
options.makeNodeAdapter = function(data, types, hasIdentity) {
types.default.classes = "u-color-1-text"
var a
a = $.apex.treeView.makeDefaultNodeAdapter( data, types );
return a;
}
return options;
}
The following sql code used as tree region source:
select
CASE
WHEN CONNECT_BY_ISLEAF = 1 THEN 0
ELSE 1
END AS NODE_STATUS,
LEVEL,
ID as ID,
NAME as title,
PARENT_ID AS PARENT_ID,
DESCRIPTION as tooltip,
ICON_HTML as icon,
TYPE
from TABLE_T
start with PARENT_ID is null
connect by prior ID = PARENT_ID
order siblings by ID ASC;
I am trying to colorize the nodes conditionally to the value of TYPE column. In this situation,
I didn't find any way to access the value of TYPE column from javascript. the node object in Apex documentation doesn't have data model that save all data into client.