Skip to content

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

@helloraj1986

Description

@helloraj1986

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions