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

Function addRow

external/.datatables.js:7550–7572  ·  view source on GitHub ↗
(r, k)

Source from the content-addressed store, hash-verified

7548 // Convert to array of TR elements
7549 var rows = []
7550 var addRow = function (r, k) {
7551 // Recursion to allow for arrays of jQuery objects
7552 if (Array.isArray(r) || r instanceof $) {
7553 for (var i = 0, ien = r.length; i < ien; i++) {
7554 addRow(r[i], k)
7555 }
7556 return
7557 }
7558
7559 // If we get a TR element, then just add it directly - up to the dev
7560 // to add the correct number of columns etc
7561 if (r.nodeName && r.nodeName.toLowerCase() === "tr") {
7562 r.setAttribute("data-dt-row", row.idx)
7563 rows.push(r)
7564 } else {
7565 // Otherwise create a row with a wrapper
7566 var created = $("<tr><td></td></tr>").attr("data-dt-row", row.idx).addClass(k)
7567
7568 $("td", created).addClass(k).html(r)[0].colSpan = _fnVisbleColumns(ctx)
7569
7570 rows.push(created[0])
7571 }
7572 }
7573
7574 addRow(data, klass)
7575

Callers 3

__details_addFunction · 0.85
addHeaderFunction · 0.85
.datatables.jsFile · 0.85

Calls 6

_fnVisbleColumnsFunction · 0.85
_createNodeFunction · 0.85
createCellPosFunction · 0.85
trimMethod · 0.80
replaceMethod · 0.80
$Function · 0.70

Tested by

no test coverage detected