How to remove an entire column on a table widget with a custom widget script
widget.on('ready', () => {
element.on('draw.dt', () => {
// Define the column names to hide
var columnsToHide = [''];
// Iterate through each column in the thead
element.find("thead th").each((index, th) => {
var columnName = $(th).text().trim();
// Check if the column name is in the list of columns to hide
if (columnsToHide.includes(columnName)) {
// Hide the entire column in thead
$(th).hide();
// Hide the entire column in each tbody row
element.find("tbody tr").each((rowIndex, row) => {
$(row).children().eq(index).hide();
});
}
});
});
});
Check out this related content:
Academy Course
Sisense Documentation
0 comments