I was wondering if we can keep track of hidden columns using "onChangeColumnHidden"
I want to use the list of columns after user hides it using "columnsButton" and use it in jsPdf to export the updated columns and its data.
Before you ask, I cant use the native export pdf since we use other features that manipulates the data in tables and exports it to pdf..
I use below code...but it doesn't work...whenever I check/uncheck the columns, it doesn't unchecks or checks the select button
const [colHide, setColHide] = React.useState([]);
const handleColumnToggle = (column, hidden) => {
if (!hidden) {
setColHide(colHide.filter(col => col !== column.field));
} else {
setColHide([...colHide, column.field]);
}
console.log(colHide)
};