Skip to content

Commit

Permalink
e6d7805c8832066ecf8917d9f42e67bb74ba03a3 Fix: Add classes for cells (…
Browse files Browse the repository at this point in the history
…`-init columns.className`) to cells before `-init createdRow` is called

https://datatables.net/forums/discussion/79681

Sync to source repo @e6d7805c8832066ecf8917d9f42e67bb74ba03a3
  • Loading branch information
dtbuild committed Aug 30, 2024
1 parent b1de1b4 commit 1470279
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion datatables.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
],
"src-repo": "http://github.com/DataTables/DataTablesSrc",
"last-tag": "2.1.4",
"last-sync": "f7aabb92d7ffea35b8c4fdfdc00b4cea45120e0e"
"last-sync": "e6d7805c8832066ecf8917d9f42e67bb74ba03a3"
}
4 changes: 3 additions & 1 deletion js/dataTables.js
Original file line number Diff line number Diff line change
Expand Up @@ -3126,6 +3126,9 @@
_fnWriteCell(nTd, display[i]);
}

// column class
_addClass(nTd, oCol.sClass);

// Visibility - add or remove as required
if ( oCol.bVisible && create )
{
Expand Down Expand Up @@ -3457,7 +3460,6 @@
var td = aoData.anCells[i];

_addClass(td, _ext.type.className[col.sType]); // auto class
_addClass(td, col.sClass); // column class
_addClass(td, oSettings.oClasses.tbody.cell); // all cells
}

Expand Down
2 changes: 1 addition & 1 deletion js/dataTables.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/dataTables.min.mjs

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion js/dataTables.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3073,6 +3073,9 @@ function _fnCreateTr ( oSettings, iRow, nTrIn, anTds )
_fnWriteCell(nTd, display[i]);
}

// column class
_addClass(nTd, oCol.sClass);

// Visibility - add or remove as required
if ( oCol.bVisible && create )
{
Expand Down Expand Up @@ -3404,7 +3407,6 @@ function _fnDraw( oSettings, ajaxComplete )
var td = aoData.anCells[i];

_addClass(td, _ext.type.className[col.sType]); // auto class
_addClass(td, col.sClass); // column class
_addClass(td, oSettings.oClasses.tbody.cell); // all cells
}

Expand Down

0 comments on commit 1470279

Please sign in to comment.