Dynamically show/hide the pagination option in the react ag-grid

Viewed 690

I am using the react ag-grid in one of my react example. I want to show/hide the pagination panel on button click once ag-grid is loaded.

<div className="ag-theme-alpine">
      <button onClick={e => setPagination(!pagination)}>Show/Hide Pagination</button>
      
      <AgGridReact
        pagination={pagination}
        ...
        ...
      >
        <AgGridColumn field="name" />
        <AgGridColumn field="year" />
      </AgGridReact>
    </div>

Look at the above sample code. When I am trying to log the pagination value then it is become true/false but it's not reflected on ag-grid.

Can you please help me how to change the grid options and refresh the react ag-grid again?

0 Answers
Related