EasyUI Forum
May 21, 2024, 07:46:09 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: getChildren for Tree node  (Read 8355 times)
leela
Newbie
*
Posts: 29


View Profile Email
« on: July 23, 2014, 03:18:34 PM »

I have a tree as in the image attached.

I am trying to retrieve the children of the Main Node, using this

Code:
$('#menuTree').tree('getChildren', parent.target);

It actually returns an array of 5 objects instead of 2.
I expected it to return only Master Entities and Admin nodes
But it is returning Master Entities, Admin, User, Screen and City

User, Screen and City are not children of Main, but the Master Entities. Not sure why it is returning all of them.

Appreciate any help.
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: July 23, 2014, 05:11:00 PM »

Please try using 'getData' or 'getNode' instead.
Code:
var t = $('#menuTree');
var p = t.tree('getData', parent.target);
var children = p.children;  // get the children nodes
Logged
iceh
Jr. Member
**
Posts: 61


View Profile
« Reply #2 on: August 12, 2014, 12:36:40 AM »

Hi,

I can confirm the "getData" works. In previous versions "getChildren" was ok, too.
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!