EasyUI Forum
May 04, 2024, 04:09:44 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 => getChecked(checked + indeterminate)  (Read 20162 times)
fl0
Newbie
*
Posts: 10


View Profile
« on: June 07, 2013, 02:30:59 AM »

Hallo there,

would it be possible to include a function that combines checked and indeterminate in the getChecked function?
In my case i can not "just" merge both results, because the tree is also a dnd tree and i need to know the order.
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: June 07, 2013, 06:16:11 AM »

Try the code below.
Code:
var n1 = $('#tt').tree('getChecked');	// get checked nodes
var n2 = $('#tt').tree('getChecked', 'indeterminate'); // get indeterminate nodes
var nodes = n1.concat(n2);
console.log(nodes);
Logged
fl0
Newbie
*
Posts: 10


View Profile
« Reply #2 on: June 13, 2013, 01:43:06 AM »

That wouldnt solve my problem.
My problem here is that i need to know the ordering of the tree.

if we define (C) means checked and (U) unchecked. The following tree

(U) A
 |---(C) B
(C) C

would lead to to the following result: B - C - A therefore C comes before A but i need to know that A comes before B
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #3 on: June 13, 2013, 06:32:23 PM »

Please try the updated tree plugin http://www.jeasyui.com/easyui/plugins/jquery.tree.js and then use the code below to retrieve checked and indeterminate nodes.
Code:
var nodes = $('#tt').tree('getChecked', ['checked','indeterminate'];
console.log(nodes)
Logged
fl0
Newbie
*
Posts: 10


View Profile
« Reply #4 on: June 14, 2013, 02:15:51 AM »

Please try the updated tree plugin http://www.jeasyui.com/easyui/plugins/jquery.tree.js and then use the code below to retrieve checked and indeterminate nodes.
Code:
var nodes = $('#tt').tree('getChecked', ['checked','indeterminate'];
console.log(nodes)

Code:
var nodes = $('#tt').tree('getChecked', ['checked','indeterminate']);
returns an empty array.
while
Code:
var nodes = $('#tt').tree('getChecked', ['checked']);
and
Code:
var nodes = $('#tt').tree('getChecked', ['indeterminate']);
works the way it should
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #5 on: June 14, 2013, 07:36:42 AM »

Be sure to include http://www.jeasyui.com/easyui/plugins/jquery.tree.js to your page. Please refer to http://jsfiddle.net/DrGYv/
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!