EasyUI Forum
December 13, 2025, 04:36:07 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Calling the tree formatter after calling update() [Solved]  (Read 11315 times)
devnull
Sr. Member
****
Posts: 431


View Profile
« on: May 21, 2015, 07:22:07 PM »

Hi;

How can I have the tree reformat one or all of it's nodes after applying the update() method ?
« Last Edit: May 21, 2015, 08:04:18 PM by devnull » Logged

-- Licensed User --
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: May 21, 2015, 07:42:20 PM »

You have to call 'update' or 'reload' methods to update the node's text.
Logged
devnull
Sr. Member
****
Posts: 431


View Profile
« Reply #2 on: May 21, 2015, 07:44:07 PM »

Thanks, yes I know that:

Code:
tr.tree('update',{target:node.target,text:'xxx'});

But how can I call the formatter() method which is defined for the tree so that it applies the formatting to the changes.
Logged

-- Licensed User --
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #3 on: May 21, 2015, 07:49:21 PM »

The 'formatter' function must be defined.
Code:
$('#tt').tree({
  formatter:function(node){
    return node.text;
  }
});

Calling 'update' method will auto apply the formatted text on the special node.
Logged
devnull
Sr. Member
****
Posts: 431


View Profile
« Reply #4 on: May 21, 2015, 07:55:33 PM »

Thanks, yes I already had the formatter, but I just discovered that there a typo error in the formatter method I created.

Thanks for the fast response.

Logged

-- Licensed User --
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!