EasyUI Forum
March 04, 2024, 01:32:21 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: Tree still show loading icon in case node doesn't have any children ?  (Read 8673 times)
jimbo
Newbie
*
Posts: 2


View Profile
« on: January 01, 2019, 11:26:47 PM »

i using Tree component with lazy-load, everything looks good, but in case a node does not have any children and result is empty, the loading icon does not disappear, So I did something wrong or this is an issue of component ?

Code:
onNodeExpand(event){
        let node = event;
        if (!node.children) {
            this.dataService.getNodes(node).subscribe((data) => node.children = data);
            // data = [] when this node doesn't have any child
        }
 }
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: January 01, 2019, 11:56:23 PM »

If a node hasn't any children, its state can't be set to 'closed'. It will be a leaf node.
Logged
jimbo
Newbie
*
Posts: 2


View Profile
« Reply #2 on: January 14, 2019, 09:34:40 PM »

If a node hasn't any children, its state can't be set to 'closed'. It will be a leaf node.
But i using lazy load,so don't know if this node have childs or not
« Last Edit: January 14, 2019, 09:44:44 PM by jimbo » Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #3 on: January 15, 2019, 06:14:27 PM »

In your server side you should determine which node has children and then set its 'state' property to 'closed'.
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!