public/javascripts/yui/datatable/datatable.js
function(el, oRecord, oColumn, oData) {
        var selectedValue = (lang.isValue(oData)) ? oData : oRecord.getData(oColumn.field),
            options = (lang.isArray(oColumn.dropdownOptions)) ?
                oColumn.dropdownOptions : null,

            selectEl,
            collection = el.getElementsByTagName("select");

        // Create the form element only once, so we can attach the onChange listener
        if(collection.length === 0) {
            // Create SELECT element
            selectEl = document.createElement("select");
            selectEl.className = DT.CLASS_DROPDOWN;
            selectEl = el.appendChild(selectEl);

            // Add event listener
            Ev.addListener(selectEl,"change",this._onDropdownChange,this);
        }

        selectEl = collection[0];

        // Update the form element
        if(selectEl) {
            // Clear out previous options
            selectEl.innerHTML = "";

            // We have options to populate
            if(options) {
                // Create OPTION elements
                for(var i=0; i<options.length; i++) {
                    var option = options[i];
                    var optionEl = document.createElement("option");
                    optionEl.value = (lang.isValue(option.value)) ?
                            option.value : option;
                    // Bug 2334323: Support legacy text, support label for consistency with DropdownCellEditor
                    optionEl.innerHTML = (lang.isValue(option.text)) ?
                            option.text : (lang.isValue(option.label)) ? option.label : option;
                    optionEl = selectEl.appendChild(optionEl);
                    if (optionEl.value == selectedValue) {
                        optionEl.selected = true;
                    }
                }
            }
            // Selected value is our only option
            else {
                selectEl.innerHTML = "<option selected value=\"" + selectedValue + "\">" + selectedValue + "</option>";
            }
        }
        else {
            el.innerHTML = lang.isValue(oData) ? oData : "";
        }
    }
function(el, oRecord, oColumn, oData) {
        var selectedValue = (lang.isValue(oData)) ? oData : oRecord.getData(oColumn.field),
            options = (lang.isArray(oColumn.dropdownOptions)) ?
                oColumn.dropdownOptions : null,

            selectEl,
            collection = el.getElementsByTagName("select");

        // Create the form element only once, so we can attach the onChange listener
        if(collection.length === 0) {
            // Create SELECT element
            selectEl = document.createElement("select");
            selectEl.className = DT.CLASS_DROPDOWN;
            selectEl = el.appendChild(selectEl);

            // Add event listener
            Ev.addListener(selectEl,"change",this._onDropdownChange,this);
        }

        selectEl = collection[0];

        // Update the form element
        if(selectEl) {
            // Clear out previous options
            selectEl.innerHTML = "";

            // We have options to populate
            if(options) {
                // Create OPTION elements
                for(var i=0; i<options.length; i++) {
                    var option = options[i];
                    var optionEl = document.createElement("option");
                    optionEl.value = (lang.isValue(option.value)) ?
                            option.value : option;
                    // Bug 2334323: Support legacy text, support label for consistency with DropdownCellEditor
                    optionEl.innerHTML = (lang.isValue(option.text)) ?
                            option.text : (lang.isValue(option.label)) ? option.label : option;
                    optionEl = selectEl.appendChild(optionEl);
                    if (optionEl.value == selectedValue) {
                        optionEl.selected = true;
                    }
                }
            }
            // Selected value is our only option
            else {
                selectEl.innerHTML = "<option selected value=\"" + selectedValue + "\">" + selectedValue + "</option>";
            }
        }
        else {
            el.innerHTML = lang.isValue(oData) ? oData : "";
        }
    }
function ( el , oRecord , oColumn , oData ) { var selectedValue = ( lang . isValue ( oData ) ) ? oData : oRecord . getData ( oColumn . field ) , options = ( lang . isArray ( oColumn . dropdownOptions ) ) ? oColumn . dropdownOptions : null , selectEl , collection = el . getElementsByTagName ( "select" ) ; // Create the form element only once, so we can attach the onChange listener if ( collection . length === 0 ) { // Create SELECT element selectEl = document . createElement ( "select" ) ; selectEl . className = DT . CLASS_DROPDOWN ; selectEl = el . appendChild ( selectEl ) ; // Add event listener Ev . addListener ( selectEl , "change" , this . _onDropdownChange , this ) ; } selectEl = collection [ 0 ] ; // Update the form element if ( selectEl ) { // Clear out previous options selectEl . innerHTML = "" ; // We have options to populate if ( options ) { // Create OPTION elements for ( var i = 0 ; i < options . length ; i ++ ) { var option = options [ i ] ; var optionEl = document . createElement ( "option" ) ; optionEl . value = ( lang . isValue ( option . value ) ) ? option . value : option ; // Bug 2334323: Support legacy text, support label for consistency with DropdownCellEditor optionEl . innerHTML = ( lang . isValue ( option . text ) ) ? option . text : ( lang . isValue ( option . label ) ) ? option . label : option ; optionEl = selectEl . appendChild ( optionEl ) ; if ( optionEl . value == selectedValue ) { optionEl . selected = true ; } } } // Selected value is our only option else { selectEl . innerHTML = "<option selected value=\"" + selectedValue + "\">" + selectedValue + "</option>" ; } } else { el . innerHTML = lang . isValue ( oData ) ? oData : "" ; } }
Formats SELECT elements.

@method DataTable.formatDropdown
@param el {HTMLElement} The element to format with markup.
@param oRecord {YAHOO.widget.Record} Record instance.
@param oColumn {YAHOO.widget.Column} Column instance.
@param oData {Object} Data value for the cell, or null.
@static
Formats SELECT elements .