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

Function _layoutResolve

external/.datatables.js:3449–3487  ·  view source on GitHub ↗

* Convert the contents of a row's layout object to nodes that can be inserted * into the document by a renderer. Execute functions, look up plug-ins, etc. * * @param {*} settings DataTables settings object * @param {*} row Layout object for this row

(settings, row)

Source from the content-addressed store, hash-verified

3447 * @param {*} row Layout object for this row
3448 */
3449 function _layoutResolve(settings, row) {
3450 var getFeature = function (feature, opts) {
3451 if (!_ext.features[feature]) {
3452 _fnLog(settings, 0, "Unknown feature: " + feature)
3453 }
3454
3455 return _ext.features[feature].apply(this, [settings, opts])
3456 }
3457
3458 var resolve = function (item) {
3459 if (!row[item]) {
3460 return
3461 }
3462
3463 var line = row[item].contents
3464
3465 for (var i = 0, ien = line.length; i < ien; i++) {
3466 if (!line[i]) {
3467 continue
3468 } else if (typeof line[i] === "string") {
3469 line[i] = getFeature(line[i], null)
3470 } else if ($.isPlainObject(line[i])) {
3471 // If it's an object, it just has feature and opts properties from
3472 // the transform in _layoutArray
3473 line[i] = getFeature(line[i].feature, line[i].opts)
3474 } else if (typeof line[i].node === "function") {
3475 line[i] = line[i].node(settings)
3476 } else if (typeof line[i] === "function") {
3477 var inst = line[i](settings)
3478
3479 line[i] = typeof inst.node === "function" ? inst.node() : inst
3480 }
3481 }
3482 }
3483
3484 resolve("start")
3485 resolve("end")
3486 resolve("full")
3487 }
3488
3489 /**
3490 * Add the options to the page HTML for the table

Callers 1

_layoutArrayFunction · 0.85

Calls 1

resolveFunction · 0.85

Tested by

no test coverage detected