# AG Grid - Invoke callbacks from custom header component

**URL:** <https://community.plotly.com/t/ag-grid-invoke-callbacks-from-custom-header-component/78335>\
**Category:** Dash Python\
**Created:** [September 6, 2023, 6:20pm UTC](https://community.plotly.com/t/ag-grid-invoke-callbacks-from-custom-header-component/78335 "2023-09-06T18:20:43Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![jinnyzor](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/jinnyzor/32/21194_2.png) [@jinnyzor](https://community.plotly.com/u/jinnyzor)\
**Post date:** [December 20, 2023, 5:43pm UTC](https://community.plotly.com/t/ag-grid-invoke-callbacks-from-custom-header-component/78335/7 "2023-12-20T17:43:16Z")

</div>

This one:

```auto
dagcomponentfuncs.ButtonHeader = function (props) {
    return React.createElement(
        'button',
        {
            onClick: () => {
            props.api.gridOptionsService.gridOptions.onCellClicked({value: {'headerClicked': props.column.colId},
            column: props.column.colId,
            rowIndex: null, node: []})},
            className: props.className,
            style: props.style,
        },
        props.displayName)
}

```

`props.api.gridOptionsServer` doesnt exist anymore.

You can do a workaround that I posted here:

> [@Column selection in Dash AG Grid](https://community.plotly.com/t/column-selection-in-dash-ag-grid/81007/6):
>
> Sure, here you go: css file: .headerSelected { background-color: #66c2a5 } js file: const {useImperativeHandle, useRef, useState, useEffect, forwardRef, Component} = React var dagfuncs = window.dashAgGridFunctions = window.dashAgGridFunctions || {}; var dagcomponentfuncs = window.dashAgGridComponentFunctions = window.dashAgGridComponentFunctions || {}; dagcomponentfuncs.SelectColumn = function (props) { const [checked, setChecked] = useState(JSON.parse(localStorage.getItem…

---

_[View the full topic](https://community.plotly.com/t/ag-grid-invoke-callbacks-from-custom-header-component/78335)._
