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

Function _fnSortFlatten

external/.datatables.js:5279–5344  ·  view source on GitHub ↗
(settings)

Source from the content-addressed store, hash-verified

5277 }
5278
5279 function _fnSortFlatten(settings) {
5280 var i,
5281 k,
5282 kLen,
5283 aSort = [],
5284 extSort = DataTable.ext.type.order,
5285 aoColumns = settings.aoColumns,
5286 aDataSort,
5287 iCol,
5288 sType,
5289 srcCol,
5290 fixed = settings.aaSortingFixed,
5291 fixedObj = $.isPlainObject(fixed),
5292 nestedSort = []
5293
5294 if (!settings.oFeatures.bSort) {
5295 return aSort
5296 }
5297
5298 // Build the sort array, with pre-fix and post-fix options if they have been
5299 // specified
5300 if (Array.isArray(fixed)) {
5301 _fnSortResolve(settings, nestedSort, fixed)
5302 }
5303
5304 if (fixedObj && fixed.pre) {
5305 _fnSortResolve(settings, nestedSort, fixed.pre)
5306 }
5307
5308 _fnSortResolve(settings, nestedSort, settings.aaSorting)
5309
5310 if (fixedObj && fixed.post) {
5311 _fnSortResolve(settings, nestedSort, fixed.post)
5312 }
5313
5314 for (i = 0; i < nestedSort.length; i++) {
5315 srcCol = nestedSort[i][0]
5316
5317 if (aoColumns[srcCol]) {
5318 aDataSort = aoColumns[srcCol].aDataSort
5319
5320 for (k = 0, kLen = aDataSort.length; k < kLen; k++) {
5321 iCol = aDataSort[k]
5322 sType = aoColumns[iCol].sType || "string"
5323
5324 if (nestedSort[i]._idx === undefined) {
5325 nestedSort[i]._idx = aoColumns[iCol].asSorting.indexOf(nestedSort[i][1])
5326 }
5327
5328 if (nestedSort[i][1]) {
5329 aSort.push({
5330 src: srcCol,
5331 col: iCol,
5332 dir: nestedSort[i][1],
5333 index: nestedSort[i]._idx,
5334 type: sType,
5335 formatter: extSort[sType + "-pre"],
5336 sorter: extSort[sType + "-" + nestedSort[i][1]]

Callers 4

_fnAjaxParametersFunction · 0.85
_fnSortFunction · 0.85
_fnSortingClassesFunction · 0.85
.datatables.jsFile · 0.85

Calls 2

_fnSortResolveFunction · 0.85
indexOfMethod · 0.80

Tested by

no test coverage detected