lib/formtools/overview.js
function renderCell (record, field, model, cb) {

    let fieldName = (typeof field === 'object') ? field.fieldName : field,
        renderer = (model.schema.tree[fieldName] && model.schema.tree[fieldName].ref && linz.api.model.getObjectIdFromRefField(record[fieldName]) instanceof linz.mongoose.Types.ObjectId) ?
            'reference' :
            (record[fieldName] && linz.api.model.getObjectIdFromRefField(record[fieldName]) instanceof linz.mongoose.Types.ObjectId && linz.mongoose.models[record[fieldName].ref]) ? 'referenceValue' :
                'text';

    // Users can supply their own renderer fields (use it if provided).
    (field.renderer || cellRenderers[renderer])(record[fieldName], record, fieldName, model, function (err, value) {

        if (err) {
            return cb(err);
        }

        return cb(null, {
            label: field.label ? field.label : model.linz.formtools.labels[fieldName],
            value: value
        });

    });

}
function renderCell (record, field, model, cb) {

    let fieldName = (typeof field === 'object') ? field.fieldName : field,
        renderer = (model.schema.tree[fieldName] && model.schema.tree[fieldName].ref && linz.api.model.getObjectIdFromRefField(record[fieldName]) instanceof linz.mongoose.Types.ObjectId) ?
            'reference' :
            (record[fieldName] && linz.api.model.getObjectIdFromRefField(record[fieldName]) instanceof linz.mongoose.Types.ObjectId && linz.mongoose.models[record[fieldName].ref]) ? 'referenceValue' :
                'text';

    // Users can supply their own renderer fields (use it if provided).
    (field.renderer || cellRenderers[renderer])(record[fieldName], record, fieldName, model, function (err, value) {

        if (err) {
            return cb(err);
        }

        return cb(null, {
            label: field.label ? field.label : model.linz.formtools.labels[fieldName],
            value: value
        });

    });

}
function renderCell ( record , field , model , cb ) { let fieldName = ( typeof field === 'object' ) ? field . fieldName : field , renderer = ( model . schema . tree [ fieldName ] && model . schema . tree [ fieldName ] . ref && linz . api . model . getObjectIdFromRefField ( record [ fieldName ] ) instanceof linz . mongoose . Types . ObjectId ) ? 'reference' : ( record [ fieldName ] && linz . api . model . getObjectIdFromRefField ( record [ fieldName ] ) instanceof linz . mongoose . Types . ObjectId && linz . mongoose . models [ record [ fieldName ] . ref ] ) ? 'referenceValue' : 'text' ; // Users can supply their own renderer fields (use it if provided). ( field . renderer || cellRenderers [ renderer ] ) ( record [ fieldName ] , record , fieldName , model , function ( err , value ) { if ( err ) { return cb ( err ) ; } return cb ( null , { label : field . label ? field . label : model . linz . formtools . labels [ fieldName ] , value : value } ) ; } ) ; }
Return the rendered value of field.
@param  {Object}   record Overview record object
@param  {Object or String} Field name or Object containing field name and field label
@param  {Obect}   model  Model object
@param  {Function} cb    Callback function
@return {Object}         Return object: { label: '', value: '' }
Return the rendered value of field .