EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: nyr_jack on October 16, 2012, 12:17:16 AM



Title: How to render tree node
Post by: nyr_jack on October 16, 2012, 12:17:16 AM
I want to render nodes of tree with different color. Checked nodes are set to red color and others keep default. The tree need not display checkbox. please help! ???


Title: Re: How to render tree node
Post by: stworthy on October 16, 2012, 03:33:11 AM
The dynamic text feature is not supported in current version. But calling 'update' method can also change the specify node's color.

Code:
var node = $('#tt').tree('find',...);  // find a node
if (node){
if (node.checked){
node.text = '<span style="color:red">Text</span>';
} else {
node.text = 'Text';
}
$('#tt').tree('update', node);
}


Title: Re: How to render tree node
Post by: nyr_jack on October 18, 2012, 02:32:56 AM
Thank you!