EasyUI Forum
November 05, 2025, 03:33:29 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: problem when reload treegrid  (Read 8620 times)
CLKG
Guest
« on: August 10, 2015, 10:40:58 PM »

I use $('#tg').treegrid('reload', id) for partial refresh of a treegrid, it only works when a node already has children or had children but got deleted, which means if the node's icon is a document not a folder, after I add some children nodes to this node, the partial refresh will not work, nothing will happen to the treegrid when I invoke the reload function, I'm sure the id param is right.
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: August 10, 2015, 11:57:48 PM »

The 'reload' method works only on the non-leaf nodes. If you want to append some child nodes on a leaf by calling 'reload' method, please call 'update' method to make it become non-leaf node first.
Code:
var tg = $('#tg');
tg.treegrid('update', {
  id: id,
  row: {state:'closed'}
});
tg.treegrid('reload', id);
Logged
CLKG
Guest
« Reply #2 on: August 11, 2015, 12:36:22 AM »

Got it, thanks!
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!