I needed a way to take a set of check boxes and associate them with another check box that would act as a "check all" for them. My goals were:
1. Checking the "check all" check box will check all the managed check boxes
2. Unchecking the "check all" check box will uncheck all the managed check boxes
3. The "check all" check box will checked, unchecked, or indeterminate depending if all, none, or some of the managed checkboxes are checked.
4. An optional callback function can be provided, which will be called when the "check all" or a managed check box is checked or unchecked, but after all the states are updated. It will be passed the set of all checked managed check boxes.
So, I looked through the existing plugins, but I didn't look too hard, because I wanted an excuse to do it myself. Here's what I've got: