Please see the following link:
You will notice that I have commented out the jquery code that hides all the children.
You will also notice that Sub1->1 has been checked.
What I want to do is hide all the children (ie by uncommenting out the jquery)
and then have some jquery that looks at all the children.
If any are checked, then that parent (and all the parents before that) must be expanded.
In this example,
Main, all of Main's immediate children should be shown and Sub1's children should be shown.
Sub2 should be shown but it's children mustn't be shown as none are checked.
Please can you help me with this jquery?