public/javascripts/yui/datatable/datatable.js
function(e, oSelf) {
    // This blurs the CellEditor
    if(oSelf._oCellEditor) {
        if(oSelf._oCellEditor.fireEvent) {
            oSelf._oCellEditor.fireEvent("blurEvent", {editor: oSelf._oCellEditor});
        }
        // Backward compatibility
        else if(oSelf._oCellEditor.isActive) {
            oSelf.fireEvent("editorBlurEvent", {editor:oSelf._oCellEditor});
        }
    }

    var elTarget = Ev.getTarget(e),
        elTag = elTarget.nodeName.toLowerCase(),
        bKeepBubbling = true;
    while(elTarget && (elTag != "table")) {
        switch(elTag) {
            case "body":
                return;
            case "input":
                var sType = elTarget.type.toLowerCase();
                if(sType == "checkbox") {
                    bKeepBubbling = oSelf.fireEvent("theadCheckboxClickEvent",{target:elTarget,event:e});
                }
                else if(sType == "radio") {
                    bKeepBubbling = oSelf.fireEvent("theadRadioClickEvent",{target:elTarget,event:e});
                }
                else if((sType == "button") || (sType == "image") || (sType == "submit") || (sType == "reset")) {
                    bKeepBubbling = oSelf.fireEvent("theadButtonClickEvent",{target:elTarget,event:e});
                }
                break;
            case "a":
                bKeepBubbling = oSelf.fireEvent("theadLinkClickEvent",{target:elTarget,event:e});
                break;
            case "button":
                bKeepBubbling = oSelf.fireEvent("theadButtonClickEvent",{target:elTarget,event:e});
                break;
            case "span":
                if(Dom.hasClass(elTarget, DT.CLASS_LABEL)) {
                    bKeepBubbling = oSelf.fireEvent("theadLabelClickEvent",{target:elTarget,event:e});
                    // Backward compatibility
                    bKeepBubbling = oSelf.fireEvent("headerLabelClickEvent",{target:elTarget,event:e});
                }
                break;
            case "th":
                bKeepBubbling = oSelf.fireEvent("theadCellClickEvent",{target:elTarget,event:e});
                // Backward compatibility
                bKeepBubbling = oSelf.fireEvent("headerCellClickEvent",{target:elTarget,event:e});
                break;
            case "tr":
                bKeepBubbling = oSelf.fireEvent("theadRowClickEvent",{target:elTarget,event:e});
                // Backward compatibility
                bKeepBubbling = oSelf.fireEvent("headerRowClickEvent",{target:elTarget,event:e});
                break;
            default:
                break;
        }
        if(bKeepBubbling === false) {
            return;
        }
        else {
            elTarget = elTarget.parentNode;
            if(elTarget) {
                elTag = elTarget.nodeName.toLowerCase();
            }
        }
    }
    oSelf.fireEvent("tableClickEvent",{target:(elTarget || oSelf._elContainer),event:e});
}
function(e, oSelf) {
    // This blurs the CellEditor
    if(oSelf._oCellEditor) {
        if(oSelf._oCellEditor.fireEvent) {
            oSelf._oCellEditor.fireEvent("blurEvent", {editor: oSelf._oCellEditor});
        }
        // Backward compatibility
        else if(oSelf._oCellEditor.isActive) {
            oSelf.fireEvent("editorBlurEvent", {editor:oSelf._oCellEditor});
        }
    }

    var elTarget = Ev.getTarget(e),
        elTag = elTarget.nodeName.toLowerCase(),
        bKeepBubbling = true;
    while(elTarget && (elTag != "table")) {
        switch(elTag) {
            case "body":
                return;
            case "input":
                var sType = elTarget.type.toLowerCase();
                if(sType == "checkbox") {
                    bKeepBubbling = oSelf.fireEvent("theadCheckboxClickEvent",{target:elTarget,event:e});
                }
                else if(sType == "radio") {
                    bKeepBubbling = oSelf.fireEvent("theadRadioClickEvent",{target:elTarget,event:e});
                }
                else if((sType == "button") || (sType == "image") || (sType == "submit") || (sType == "reset")) {
                    bKeepBubbling = oSelf.fireEvent("theadButtonClickEvent",{target:elTarget,event:e});
                }
                break;
            case "a":
                bKeepBubbling = oSelf.fireEvent("theadLinkClickEvent",{target:elTarget,event:e});
                break;
            case "button":
                bKeepBubbling = oSelf.fireEvent("theadButtonClickEvent",{target:elTarget,event:e});
                break;
            case "span":
                if(Dom.hasClass(elTarget, DT.CLASS_LABEL)) {
                    bKeepBubbling = oSelf.fireEvent("theadLabelClickEvent",{target:elTarget,event:e});
                    // Backward compatibility
                    bKeepBubbling = oSelf.fireEvent("headerLabelClickEvent",{target:elTarget,event:e});
                }
                break;
            case "th":
                bKeepBubbling = oSelf.fireEvent("theadCellClickEvent",{target:elTarget,event:e});
                // Backward compatibility
                bKeepBubbling = oSelf.fireEvent("headerCellClickEvent",{target:elTarget,event:e});
                break;
            case "tr":
                bKeepBubbling = oSelf.fireEvent("theadRowClickEvent",{target:elTarget,event:e});
                // Backward compatibility
                bKeepBubbling = oSelf.fireEvent("headerRowClickEvent",{target:elTarget,event:e});
                break;
            default:
                break;
        }
        if(bKeepBubbling === false) {
            return;
        }
        else {
            elTarget = elTarget.parentNode;
            if(elTarget) {
                elTag = elTarget.nodeName.toLowerCase();
            }
        }
    }
    oSelf.fireEvent("tableClickEvent",{target:(elTarget || oSelf._elContainer),event:e});
}
function ( e , oSelf ) { // This blurs the CellEditor if ( oSelf . _oCellEditor ) { if ( oSelf . _oCellEditor . fireEvent ) { oSelf . _oCellEditor . fireEvent ( "blurEvent" , { editor : oSelf . _oCellEditor } ) ; } // Backward compatibility else if ( oSelf . _oCellEditor . isActive ) { oSelf . fireEvent ( "editorBlurEvent" , { editor : oSelf . _oCellEditor } ) ; } } var elTarget = Ev . getTarget ( e ) , elTag = elTarget . nodeName . toLowerCase ( ) , bKeepBubbling = true ; while ( elTarget && ( elTag != "table" ) ) { switch ( elTag ) { case "body" : return ; case "input" : var sType = elTarget . type . toLowerCase ( ) ; if ( sType == "checkbox" ) { bKeepBubbling = oSelf . fireEvent ( "theadCheckboxClickEvent" , { target : elTarget , event : e } ) ; } else if ( sType == "radio" ) { bKeepBubbling = oSelf . fireEvent ( "theadRadioClickEvent" , { target : elTarget , event : e } ) ; } else if ( ( sType == "button" ) || ( sType == "image" ) || ( sType == "submit" ) || ( sType == "reset" ) ) { bKeepBubbling = oSelf . fireEvent ( "theadButtonClickEvent" , { target : elTarget , event : e } ) ; } break ; case "a" : bKeepBubbling = oSelf . fireEvent ( "theadLinkClickEvent" , { target : elTarget , event : e } ) ; break ; case "button" : bKeepBubbling = oSelf . fireEvent ( "theadButtonClickEvent" , { target : elTarget , event : e } ) ; break ; case "span" : if ( Dom . hasClass ( elTarget , DT . CLASS_LABEL ) ) { bKeepBubbling = oSelf . fireEvent ( "theadLabelClickEvent" , { target : elTarget , event : e } ) ; // Backward compatibility bKeepBubbling = oSelf . fireEvent ( "headerLabelClickEvent" , { target : elTarget , event : e } ) ; } break ; case "th" : bKeepBubbling = oSelf . fireEvent ( "theadCellClickEvent" , { target : elTarget , event : e } ) ; // Backward compatibility bKeepBubbling = oSelf . fireEvent ( "headerCellClickEvent" , { target : elTarget , event : e } ) ; break ; case "tr" : bKeepBubbling = oSelf . fireEvent ( "theadRowClickEvent" , { target : elTarget , event : e } ) ; // Backward compatibility bKeepBubbling = oSelf . fireEvent ( "headerRowClickEvent" , { target : elTarget , event : e } ) ; break ; default : break ; } if ( bKeepBubbling === false ) { return ; } else { elTarget = elTarget . parentNode ; if ( elTarget ) { elTag = elTarget . nodeName . toLowerCase ( ) ; } } } oSelf . fireEvent ( "tableClickEvent" , { target : ( elTarget || oSelf . _elContainer ) , event : e } ) ; }
Handles click events on the THEAD element.

@method _onTheadClick
@param e {HTMLEvent} The click event.
@param oSelf {YAHOO.wiget.DataTable} DataTable instance.
@private
Handles click events on the THEAD element .