refreshIndeterminateState() {
        const oldValue = this.indeterminate();
        this.state('indeterminate', false);

        if (this.hasChildren()) {
            const childrenCount = this.children.length;
            let indeterminate = 0;
            let checked = 0;

            this.children.each(n => {
                if (n.checked()) {
                    checked++;
                }

                if (n.indeterminate()) {
                    indeterminate++;
                }
            });

            // Set selected if all children are
            if (checked === childrenCount) {
                baseStateChange('checked', true, 'checked', this);
            }
            else {
                baseStateChange('checked', false, 'unchecked', this);
            }

            // Set indeterminate if any children are, or some children are selected
            if (!this.checked()) {
                this.state('indeterminate', indeterminate > 0 || (childrenCount > 0 && checked > 0 && checked < childrenCount));
            }
        }

        if (this.hasParent()) {
            this.getParent().refreshIndeterminateState();
        }

        if (oldValue !== this.state('indeterminate')) {
            this.markDirty();
        }

        return this;
    }
Update the indeterminate state of this node by scanning states of children.

True if some, but not all children are checked.
False if no children are checked.

@return {TreeNode} Node object.