![ag grid column types ag grid column types](https://visme.co/blog/wp-content/uploads/2018/03/How-Grids-Can-Help-You-Create-Professional-Looking-Designs-Column-Grid-magazine-02.png)
Grid StateĪs a user interacts with the grid they may change state such as filtering, sorting and column order. OnGridReady = useCallback ( ( event : GridReadyEvent ) =>, ) įor a full list of api methods see: Grid API. access api directly within event handler The api is also provided on the params for all grid events and callbacks. Work), consider listening to the gridReady event. If you want to access the api as soon as it's available (ie do initialisation The gridRef.current value will not be defined until after the AgGridReact component has been initialised. For these properties the grid must be destroyed and re-created for the new value to take effect. These options are marked as Initial on the Options Reference. Their value is only read during the initial setup of the grid. setGridOption ( 'rowHeight', 50 ) Initial Grid OptionsĪ small number of Grid Options do not support updating their value.
![ag grid column types ag grid column types](https://i.stack.imgur.com/yZxVr.png)
We recommend updating options via AgGridReact props but it is also possible to updated a property via api.setGridOption or api.updateGridOptions. const = useState ( 25 ) // Callback to update the rowHeight const updateHeight = ( ) => setRowHeight ( 50 ) In this example all the rows will be redrawn with the new height. Simply update your state and the grid will respond to the new value. For example, you may want to change rowHeight via an application toggle. It is a common requirement to update a grid option after the grid has been created. When setting properties, it's best to treat non-simple types as immutable objects (e.g.