EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: sky-t on March 24, 2020, 12:22:27 AM



Title: Tree append node add class
Post by: sky-t on March 24, 2020, 12:22:27 AM
Hi there,

i need to append nodes to a tree and set css classes to the appended nodes.
How can i do that?

Thanks


Title: Re: Tree append node add class
Post by: sky-t on March 28, 2020, 01:26:34 AM
Anybody an idea??


Title: Re: Tree append node add class
Post by: jarry on March 29, 2020, 11:33:29 PM
The tree node doesn't accept css classes, please try to define the 'formatter' function to format your node's text value, or set the css class on the 'text' value.
Code:
t.tree('append', {
parent: node.target,
data: [{
id: 1233,
text: '<span class="mynode">name1233</span>'
}]
})