MCPcopy Create free account
hub / github.com/OpenIntroStat/ims / selectCells

Function selectCells

libs/datatables-binding-0.18/datatables.js:1200–1215  ·  view source on GitHub ↗
(ignoreSelectable)

Source from the content-addressed store, hash-verified

1198 // Change selected3's value based on selectable3, then
1199 // refresh the cell selection state according to values in selected3
1200 var selectCells = function(ignoreSelectable) {
1201 if (!ignoreSelectable) onlyKeepSelectableCells();
1202 table.$('td.' + selClass).removeClass(selClass);
1203 if (selected3.length === 0) return;
1204 if (server) {
1205 table.cells({page: 'current'}).every(function() {
1206 var info = tweakCellIndex(this);
1207 if (findIndex([info.row, info.col], selected3) > -1)
1208 $(this.node()).addClass(selClass);
1209 });
1210 } else {
1211 selected3.map(function(ij) {
1212 $(table.cell(ij[0] - 1, ij[1]).node()).addClass(selClass);
1213 });
1214 }
1215 };
1216 table.on('click.dt', 'tbody td', function() {
1217 var $this = $(this), info = tweakCellIndex(table.cell(this));
1218 if ($this.hasClass(selClass)) {

Callers 1

datatables.jsFile · 0.85

Calls 4

onlyKeepSelectableCellsFunction · 0.85
tweakCellIndexFunction · 0.85
findIndexFunction · 0.85
$Function · 0.50

Tested by

no test coverage detected