Code: Select all
if (!nuGlobalAccess()) {
var columnIndex = 0;
nuSetBrowseColumnSize(columnIndex, 0);
nuPrintExcludeColumns([columnIndex]);
}
Code: Select all
if (!nuGlobalAccess()) {
var columnIndex = 0;
nuSetBrowseColumnSize(columnIndex, 0);
nuPrintExcludeColumns([columnIndex]);
}
Code: Select all
if (!nuGlobalAccess()) {
var columnIndex = 0;
nuSetBrowseColumnSize(columnIndex, 0);
nuPrintExcludeColumns([columnIndex]);
}
function hideBlankColumns(tableId) {
// Find the table element using its ID.
const table = document.getElementById(tableId);
if (!table) {
console.error(`Table with ID "${tableId}" not found.`);
return;
}
hideBlankColumns('cases');
// Get all table rows.
const rows = table.querySelectorAll('tr');
if (rows.length === 0) {
return; // No data rows to process.
}
// Determine the number of columns.
const colCount = rows[0].querySelectorAll('th, td').length;
const isColumnBlank = new Array(colCount).fill(true);
// Iterate through all table rows, skipping the header.
for (let i = 1; i < rows.length; i++) {
const cells = rows[i].querySelectorAll('td');
for (let j = 0; j < cells.length; j++) {
// Check if the cell has content. Trim whitespace for accuracy.
if (cells[j].textContent.trim() !== '') {
isColumnBlank[j] = false; // Mark column as not blank.
}
}
}
// Apply styling to hide the blank columns.
const headerCells = rows[0].querySelectorAll('th, td');
for (let j = 0; j < colCount; j++) {
if (isColumnBlank[j]) {
// Hide the column header.
if (headerCells[j]) {
headerCells[j].style.display = 'none';
}
// Hide all corresponding data cells in that column.
for (let i = 1; i < rows.length; i++) {
const cells = rows[i].querySelectorAll('td');
if (cells[j]) {
cells[j].style.display = 'none';
}
}
}
}
}
Code: Select all
if (!nuGlobalAccess()) {
var columnIndex = 0;
nuSetBrowseColumnSize(columnIndex, 0);
hideBlankColumns();
nuPrintExcludeColumns([columnIndex]);
}
function hideBlankColumns() {
// Find the browse container element using its ID
const browseDiv = document.getElementById('nuRECORD');
if (!browseDiv) {
console.error(`Browse div with ID "${'nuRECORD'}" not found.`);
return;
}
// Get all browse title divs (headers)
const headers = browseDiv.querySelectorAll('.nuBrowseTitle');
if (headers.length === 0) {
console.error('No browse title headers found.');
return;
}
const colCount = headers.length;
const isColumnBlank = new Array(colCount).fill(true);
// Get all data cells (excluding empty rows)
const dataCells = browseDiv.querySelectorAll('.nuCell[data-nu-column]');
// Check each data cell to see if the column has content
dataCells.forEach(cell => {
const colIndex = parseInt(cell.getAttribute('data-nu-column'));
const content = cell.textContent.trim();
// Mark column as not blank if it has content
if (content !== '' && colIndex >= 0) {
isColumnBlank[colIndex] = false;
}
});
// Hide blank columns using nuBuilder's built-in function
for (let j = 0; j < colCount; j++) {
if (isColumnBlank[j]) {
nuSetBrowseColumnSize(j, 0);
}
}
}
Code: Select all
nuPrintExcludeColumns([colIndex]);
Code: Select all
if (!nuGlobalAccess()) {
var columnIndex = 0;
nuSetBrowseColumnSize(columnIndex, 0);
hideBlankColumns();
nuPrintExcludeColumns([columnIndex]);
isColumnBlank[colIndex];
nuPrintExcludeColumns([colIndex]);
}
Code: Select all
if (!nuGlobalAccess()) {
// Get hidden columns from hideBlankColumns
const hiddenColumns = hideBlankColumns();
// Add the manually specified column index
var columnIndex = 0;
// Combine both arrays and remove duplicates
const columnsToExclude = [...new Set([columnIndex, ...hiddenColumns])];
// Exclude all columns
nuPrintExcludeColumns(columnsToExclude);
}
function hideBlankColumns() {
const hiddenColumns = [];
// Find the browse container element using its ID
const browseDiv = document.getElementById('nuRECORD');
if (!browseDiv) {
console.error(`Browse div with ID "${'nuRECORD'}" not found.`);
return hiddenColumns;
}
// Get all browse title divs (headers)
const headers = browseDiv.querySelectorAll('.nuBrowseTitle');
if (headers.length === 0) {
console.error('No browse title headers found.');
return hiddenColumns;
}
const colCount = headers.length;
const isColumnBlank = new Array(colCount).fill(true);
// Get all data cells (excluding empty rows)
const dataCells = browseDiv.querySelectorAll('.nuCell[data-nu-column]');
// Check each data cell to see if the column has content
dataCells.forEach(cell => {
const colIndex = parseInt(cell.getAttribute('data-nu-column'));
const content = cell.textContent.trim();
// Mark column as not blank if it has content
if (content !== '' && colIndex >= 0) {
isColumnBlank[colIndex] = false;
}
});
// Hide blank columns using nuBuilder's built-in function
for (let j = 0; j < colCount; j++) {
if (isColumnBlank[j]) {
nuSetBrowseColumnSize(j, 0);
hiddenColumns.push(j);
}
}
return hiddenColumns;
}