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

How to use "onChangeColumnHidden" to keep track of hidden columns #62

Open
helloraj1986 opened this issue Jan 30, 2023 · 0 comments
Open

Comments

@helloraj1986
Copy link

helloraj1986 commented Jan 30, 2023

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)
};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant