[zTree] Getting the data out

[zTree] Getting the data out

  
Forge Component
(8)
Published on 11 Nov (4 weeks ago) by Eduardo Luís
8 votes
Published on 11 Nov (4 weeks ago) by Eduardo Luís
Now I have this beautiful tree with checkboxes, and when the user pressers the Save button I'd like to know the checkbox statusses from the tree (either at that moment, or dynamically during the checking). What would be the best way to do this?
Hello again,

for that you have to put the tree "talking" with the server. 
Both ways are possible (the Save button or during the checking).
For the first option you can use the 'getChangeCheckedNodes', 'getCheckedNodes', 'getUnCheckedNodes' actions. See the 'Statistics Checkbox is Checked' example.
For the second option you will have to use callback functions namelly 'beforeCheck' and/or 'onCheck'. There are lots of examples where the tree "talks" with the server but the one closest that you want is the 'Checkbox -zTree Methods' example.


Ok, thanks very much, I'll check it out.