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

Function structureFill

external/.datatables.js:17416–17435  ·  view source on GitHub ↗

* Convert the DataTables header structure array into a 2D array where each * element has a reference to its TH/TD cell (regardless of spanning). * * @param structure Header / footer structure object * @returns 2D array of header cells

(structure)

Source from the content-addressed store, hash-verified

17414 * @returns 2D array of header cells
17415 */
17416 function structureFill(structure) {
17417 var filledIn = []
17418 for (var row = 0; row < structure.length; row++) {
17419 filledIn.push([])
17420 for (var col = 0; col < structure[row].length; col++) {
17421 var cell = structure[row][col]
17422 if (cell) {
17423 for (var rowInner = 0; rowInner < cell.rowspan; rowInner++) {
17424 if (!filledIn[row + rowInner]) {
17425 filledIn[row + rowInner] = []
17426 }
17427 for (var colInner = 0; colInner < cell.colspan; colInner++) {
17428 filledIn[row + rowInner][col + colInner] = cell.cell
17429 }
17430 }
17431 }
17432 }
17433 }
17434 return filledIn
17435 }
17436 /**
17437 * Convert the index type
17438 *

Callers 1

validateStructureMoveFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected