If you are planning to display only certain data rows based on a condition in DataTables.net, here is the JavaScript code to do that.
function ToggleDataTableRows() {
if (dataTableObject != null) {let hideSomeDataChecked = $("#hideSomeDataCheckBox").is(":checked");if (hideSomeDataChecked == true) {$.fn.dataTable.ext.search.push(function (settings, data, dataIndex) {// If data in 6th Column does not meet some condition// return true. Which means some rows are being hidden now.if (data[5] != "SomeCondition") {return true;}});}else {// Retrieve data// var data = hpDataTable.column(1, { search: 'applied' }).data();// Restore search criteria$.fn.dataTable.ext.search.pop();}displayTableObject.draw();}}