This question follows on from:
Please this the update example:
What I want to do is constrain the 'select all' to within the relevant tree.
For example, if the user clicks on Select All under the 'Main' tree, then only the checkboxes under Main (including any grandchildren should be checked (and vice versa).
Currently, it is also checking items in the Main2 tree.
How can I amend the code to work with this scenerio (note the sub_xxx IDs are pulled from the db and aren't static).
Many Thanks as usual!