Description

The TristateCheckbox allows any checkbox element to have an extra state defined. this state means that some of it's children are selected, but not all of them

This gets determined by a built in dependencySelector. it is customizable to almost any context

one tristate can even set the state of another, this is all built in via events

Basic Usage

Basic tri-state (has little to no function like this) :

                markup
                
                    <input id="cb-1" type="checkbox"/>
                
                script
                
                    document.observe('dom:loaded', function() {
                        new TriStateCheckbox('cb-1');
                    });
                
                

Advanced Usage

normal tri-state :
child 1 :
child 2 :
child 3 :

                markup
                
                    <input id="cb-a-1" type="checkbox"/>
                    <input id="cb-c-1" type="checkbox"/>
                    <input id="cb-c-2" type="checkbox"/>
                    <input id="cb-c-3" type="checkbox"/>
                
                script
                
                    document.observe('dom:loaded', function() {
                        new TriStateCheckbox('cb-a-1', {
                            dependantSelector: 'form#adv-usage input[id^="cb-c"]'
                        });
                    });