rice-framework/krad-web/src/main/webapp/krad/scripts/krad.utility.js
/**
 * Get the value from a table cell
 *
 * @param element
 * @return value the value
 */
Get the value from a table cell

@param element
@return value the value
Get the value from a table cell @param element @return value the value
function coerceTableCellValue(element) {
    var tdObject = jQuery(element);
    var inputField = tdObject.find(':input');
    var inputFieldValue;
    if (inputField.length > 0) {
        inputFieldValue = inputField.val();
    } else if (tdObject.is(kradVariables.INPUT_FIELD_SELECTOR) || tdObject.is("." + kradVariables.FIELD_CLASS)) {
        if (tdObject.find(kradVariables.INLINE_EDIT.VIEW_CLASS).length) {
            inputFieldValue = getImmediateChildText(tdObject.find(kradVariables.INLINE_EDIT.VIEW_CLASS)[0]).trim();
        }
        else if (tdObject.find("> span").length) {
            inputFieldValue = getImmediateChildText(tdObject.find("> span")[0]).trim();
        }
        else {
            inputFieldValue = getImmediateChildText(tdObject[0]).trim();
        }
    } else if (tdObject.is("span")) {
        inputFieldValue = getImmediateChildText(tdObject[0]).trim();
    } else {
        inputFieldValue = element;
    }
    if (inputFieldValue && inputFieldValue.toUpperCase() == "TRUE") {
        inputFieldValue = true;
    } else if (inputFieldValue && inputFieldValue.toUpperCase() == "FALSE") {
        inputFieldValue = false;
    }
    if (inputFieldValue === "" || inputField.prop("disabled") || tdObject.hasClass("uif-groupRow")) {
        return "";
    } else {
        return inputFieldValue;
    }
}
function coerceTableCellValue ( element ) { var tdObject = jQuery ( element ) ; var inputField = tdObject . find ( ':input' ) ; var inputFieldValue ; if ( inputField . length > 0 ) { inputFieldValue = inputField . val ( ) ; } else if ( tdObject . is ( kradVariables . INPUT_FIELD_SELECTOR ) || tdObject . is ( "." + kradVariables . FIELD_CLASS ) ) { if ( tdObject . find ( kradVariables . INLINE_EDIT . VIEW_CLASS ) . length ) { inputFieldValue = getImmediateChildText ( tdObject . find ( kradVariables . INLINE_EDIT . VIEW_CLASS ) [ 0 ] ) . trim ( ) ; } else if ( tdObject . find ( "> span" ) . length ) { inputFieldValue = getImmediateChildText ( tdObject . find ( "> span" ) [ 0 ] ) . trim ( ) ; } else { inputFieldValue = getImmediateChildText ( tdObject [ 0 ] ) . trim ( ) ; } } else if ( tdObject . is ( "span" ) ) { inputFieldValue = getImmediateChildText ( tdObject [ 0 ] ) . trim ( ) ; } else { inputFieldValue = element ; } if ( inputFieldValue && inputFieldValue . toUpperCase ( ) == "TRUE" ) { inputFieldValue = true ; } else if ( inputFieldValue && inputFieldValue . toUpperCase ( ) == "FALSE" ) { inputFieldValue = false ; } if ( inputFieldValue === "" || inputField . prop ( "disabled" ) || tdObject . hasClass ( "uif-groupRow" ) ) { return "" ; } else { return inputFieldValue ; } }
Get the value from a table cell
Get the value from a table cell
//TODO : use coerceValue()? would we do totals on other types of input
 // readonly fields
 // after sorting
 // boolean matching
 //skip these situations - blank, disabled, grouping td
