MCPcopy Create free account
hub / github.com/breck7/scroll / _fnFilterCustom

Function _fnFilterCustom

external/.datatables.js:4110–4133  ·  view source on GitHub ↗

* Apply custom filtering functions * * This is legacy now that we have named functions, but it is widely used * from 1.x, so it is not yet deprecated. * @param {object} oSettings dataTables settings object * @memberof DataTable#oApi

(settings)

Source from the content-addressed store, hash-verified

4108 * @memberof DataTable#oApi
4109 */
4110 function _fnFilterCustom(settings) {
4111 var filters = DataTable.ext.search
4112 var displayRows = settings.aiDisplay
4113 var row, rowIdx
4114
4115 for (var i = 0, ien = filters.length; i < ien; i++) {
4116 var rows = []
4117
4118 // Loop over each row and see if it should be included
4119 for (var j = 0, jen = displayRows.length; j < jen; j++) {
4120 rowIdx = displayRows[j]
4121 row = settings.aoData[rowIdx]
4122
4123 if (filters[i](settings, row._aFilterData, rowIdx, row._aData, j)) {
4124 rows.push(rowIdx)
4125 }
4126 }
4127
4128 // So the array reference doesn't break set the results into the
4129 // existing array
4130 displayRows.length = 0
4131 displayRows.push.apply(displayRows, rows)
4132 }
4133 }
4134
4135 /**
4136 * Filter the data table based on user input and draw the table

Callers 1

_fnFilterCompleteFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected