Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If a column was invisible in the Datatable, the wrong Column target was used #2464

Merged
merged 4 commits into from
Jan 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions méli-mélo/2024-10-datatable-utilities/index-en.html
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ <h2 id="a2">Column Data Manipulation Example 1</h2>
{ "data": "DepartmentEN" },
{ "data": "ContactEmail" },
{ "data": "Custom study titleEN" },
{ "data": "Registration number" },
{ "data": "Registration number", "visible": false },
{ "data": "Contract value" }
],
"columnDefs": [{ "className": "text-left", "targets": [0]},
Expand Down Expand Up @@ -289,4 +289,4 @@ <h3>Code</h3>
</tr>
</tfoot>
</table>
</div>
</div>
4 changes: 2 additions & 2 deletions méli-mélo/2024-10-datatable-utilities/index-fr.html
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ <h2 id="a2">Exemple 1 de manipulation des données de colonne</h2>
{ "data": "DepartmentFR" },
{ "data": "ContactEmail" },
{ "data": "Custom study titleFR" },
{ "data": "Registration number" },
{ "data": "Registration number", "visible": false },
{ "data": "Contract value" }
],
"columnDefs": [{ "className": "text-left", "targets": [0]},
Expand Down Expand Up @@ -290,4 +290,4 @@ <h3>Code</h3>
</tr>
</tfoot>
</table>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,24 @@
var moneyFormat = [];
var urlColTarget = [];

var oColumnNames = oTable.settings().init().columns;
var oAllColumnNames = oTable.settings().init().columns;

var oGetColumnVisibility = oTable.columns().visible();

/**
* Only put Visible Columns in the list of Available ColumnNames
*/

var oColumnNames = [];


for (var key in oAllColumnNames)
{
if (oGetColumnVisibility[key])
{
oColumnNames.push(oAllColumnNames[key]);
}
}

/**
* Find all table columns that have
Expand Down
Loading