EasyUI Forum
April 28, 2024, 12:12:46 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Tree append node add class  (Read 3315 times)
sky-t
Full Member
***
Posts: 145


View Profile
« 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
Logged
sky-t
Full Member
***
Posts: 145


View Profile
« Reply #1 on: March 28, 2020, 01:26:34 AM »

Anybody an idea??
Logged
jarry
Administrator
Hero Member
*****
Posts: 2262


View Profile Email
« Reply #2 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>'
}]
})
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!