lib/builder.js
function parseResponse(queryResult) {
        var oQuery = self.oRequestQuery;
        var result = { recordsFiltered: 0, recordsTotal: 0 };
        if (oQuery && typeof oQuery.draw === 'string') {
            // Cast for security reasons, as per http://datatables.net/usage/server-side
            result.draw = parseInt(oQuery.draw,10);
        } else {
            result.draw = 0;
        }
        if (_u.isObject(queryResult) && _u.keys(queryResult).length > 1) {
            result.recordsFiltered = result.recordsTotal = extractResponseVal(queryResult.recordsTotal) || 0;
            if (queryResult.recordsFiltered) {
                result.recordsFiltered = extractResponseVal(queryResult.recordsFiltered) || 0;
            }
            result.data = queryResult.select;
        }
        return result;
    }
function parseResponse(queryResult) {
        var oQuery = self.oRequestQuery;
        var result = { recordsFiltered: 0, recordsTotal: 0 };
        if (oQuery && typeof oQuery.draw === 'string') {
            // Cast for security reasons, as per http://datatables.net/usage/server-side
            result.draw = parseInt(oQuery.draw,10);
        } else {
            result.draw = 0;
        }
        if (_u.isObject(queryResult) && _u.keys(queryResult).length > 1) {
            result.recordsFiltered = result.recordsTotal = extractResponseVal(queryResult.recordsTotal) || 0;
            if (queryResult.recordsFiltered) {
                result.recordsFiltered = extractResponseVal(queryResult.recordsFiltered) || 0;
            }
            result.data = queryResult.select;
        }
        return result;
    }
function parseResponse ( queryResult ) { var oQuery = self . oRequestQuery ; var result = { recordsFiltered : 0 , recordsTotal : 0 } ; if ( oQuery && typeof oQuery . draw === 'string' ) { // Cast for security reasons, as per http://datatables.net/usage/server-side result . draw = parseInt ( oQuery . draw , 10 ) ; } else { result . draw = 0 ; } if ( _u . isObject ( queryResult ) && _u . keys ( queryResult ) . length > 1 ) { result . recordsFiltered = result . recordsTotal = extractResponseVal ( queryResult . recordsTotal ) || 0 ; if ( queryResult . recordsFiltered ) { result . recordsFiltered = extractResponseVal ( queryResult . recordsFiltered ) || 0 ; } result . data = queryResult . select ; } return result ; }
Parse the responses from the database and build a Datatable response object.
@param queryResult An array of SQL response objects, each of which must, in order, correspond with a query string
returned by buildQuery.
@return {Object} A Datatable reply that is suitable for sending in a response to the client.
Parse the responses from the database and build a Datatable response object .