YAHOO.widget.DataTable.formatLookup = function(elCell, oRecord, oColumn, oData) {
// determine whether there are multiple selections in the
oDataArray = oData.split (‘,’);
if (oDataArray.length > 1) {

}

var lookupTable = oColumn.lookupTable || (oColumn.editor instanceof YAHOO.widget.CheckboxCellEditor) && oColumn.editor.checkboxOptions;
if (!YAHOO.lang.isArray(lookupTable)) {
lookupTable = oColumn.lookupTable || (oColumn.editor instanceof YAHOO.widget.DropdownCellEditor) && oColumn.editor.dropdownOptions;
if (!YAHOO.lang.isArray(lookupTable)) {
lookupTable = oColumn.lookupTable || (oColumn.editor instanceof YAHOO.widget.RadioCellEditor) && oColumn.editor.radioOptions;
if (!YAHOO.lang.isArray(lookupTable)) {
alert (“JS ERROR: unknown options type for “Lookup” formattern Error from column: ‘” + oColumn.key + “””);
}
}

}

var sponsored_donkeys = new Array();
if (YAHOO.lang.isArray(lookupTable)) {
for (var i2 = 0; i2 < oDataArray.length; i2++) {
for (var i = 0; i < lookupTable.length; i++) {
if (oDataArray [i2] === lookupTable[i].value) {
sponsored_donkeys [i2] = lookupTable[i].label;
}
}
}
}

elCell.innerHTML = sponsored_donkeys.join (',');
return;

elCell.innerHTML = oData || ""; // if oData is null, show a blank.
};
YAHOO.widget.DataTable.Formatter.lookup = YAHOO.widget.DataTable.formatLookup

for the table column definition use:
formatter:"lookup"

Advertisements