ButuzGOL
ButuzGOL

Reputation: 1243

Aggrid refresh after state of rowGroupPanelShow changed

After changing rowGroupPanelShow from "always" to "never" group panel top doest hide. Is there any refreshView method i need to call from Grid instance ?

Code

this.setState({ rowGroupPanelShow: 'never' });

Upvotes: 1

Views: 695

Answers (1)

NearHuscarl
NearHuscarl

Reputation: 81340

One easy way to get what you want quickly is to hide that component via css. Remember to provide a unique id for your table so you can find the exact component to toggle visibility

Setup

const showRowGroupPanel = () => {
  const el = document.querySelector(`#myTableId .ag-column-drop-wrapper`);
  el.style.display = "";
};
const hideRowGroupPanel = () => {
  const el = document.querySelector(`#myTableId .ag-column-drop-wrapper`);
  el.style.display = "none";
};

...

<button onClick={showRowGroupPanel}>Show</button>
<button onClick={hideRowGroupPanel}>Hide</button>
<div
  style={{ height: "100%", width: "100%" }}
  className="ag-theme-balham"
  id="myTableId"
>
  <AgGridReact {...}/>
</div>

Live Example

Edit AgGrid Toggle Row Group Panel

Upvotes: 1

Related Questions