lib/api/formtools/list.js
function renderFilters (req, modelName, cb) {

    if (!req) {
        throw new Error('req is required.');
    }

    if (typeof modelName !== 'string' || !modelName.length) {
        throw new Error('modelName is required and must be of type String and cannot be empty.');
    }

    linz.api.model.list(req, modelName, function (err, list) {

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

        if (!Object.keys(list.filters).length) {
            return cb(null);
        }

        async.each(Object.keys(list.filters), function (fieldName, filtersDone) {

            // call the filter renderer and update the content with the result
            list.filters[fieldName].filter.renderer(fieldName, function (filterErr, result) {

                if (filterErr) {
                    return filtersDone(filterErr);
                }

                list.filters[fieldName].formControls = result;

                return filtersDone(null);

            });

        }, function (filterErr) {

            return cb(filterErr, list.filters);

        });

    });

}
function renderFilters (req, modelName, cb) {

    if (!req) {
        throw new Error('req is required.');
    }

    if (typeof modelName !== 'string' || !modelName.length) {
        throw new Error('modelName is required and must be of type String and cannot be empty.');
    }

    linz.api.model.list(req, modelName, function (err, list) {

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

        if (!Object.keys(list.filters).length) {
            return cb(null);
        }

        async.each(Object.keys(list.filters), function (fieldName, filtersDone) {

            // call the filter renderer and update the content with the result
            list.filters[fieldName].filter.renderer(fieldName, function (filterErr, result) {

                if (filterErr) {
                    return filtersDone(filterErr);
                }

                list.filters[fieldName].formControls = result;

                return filtersDone(null);

            });

        }, function (filterErr) {

            return cb(filterErr, list.filters);

        });

    });

}
function renderFilters ( req , modelName , cb ) { if ( ! req ) { throw new Error ( 'req is required.' ) ; } if ( typeof modelName !== 'string' || ! modelName . length ) { throw new Error ( 'modelName is required and must be of type String and cannot be empty.' ) ; } linz . api . model . list ( req , modelName , function ( err , list ) { if ( err ) { return cb ( err ) ; } if ( ! Object . keys ( list . filters ) . length ) { return cb ( null ) ; } async . each ( Object . keys ( list . filters ) , function ( fieldName , filtersDone ) { // call the filter renderer and update the content with the result list . filters [ fieldName ] . filter . renderer ( fieldName , function ( filterErr , result ) { if ( filterErr ) { return filtersDone ( filterErr ) ; } list . filters [ fieldName ] . formControls = result ; return filtersDone ( null ) ; } ) ; } , function ( filterErr ) { return cb ( filterErr , list . filters ) ; } ) ; } ) ; }
Get list filter settings and execute render method to obtain the HTML markup
@param {String}   req       A HTTP request object.
@param {String}   modelName Name of model
@param {Function} cb        Callback function
@return {Object} or undefined
@api public
Get list filter settings and execute render method to obtain the HTML markup