hide-column
Description
Fires when hiding a columnUsage
"hide-column": ({
id: string,
mode: boolean
}) => boolean|void;
Parameters
The callback of the action takes an object with the following parameters:
id
- (required) the ID of a column that is hiddenmode
- (required) if set to true, hides a column; if false, a column is shown
Returning false from the event handler will block hiding a column.
Example
const { data, columns } = getData();
export default function App() {
const api = useRef(null);
const hideColumn = () => {
api.current.exec("hide-column", { id: "firstName", mode: true });
};
return (
<>
<button onClick={hideColumn} >Hide</button>
<Grid data={data} columns={columns} api={api} />
</>
);
}
Related articles: