Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stumped - Cannot Access API Methods in React Using gridRef #7965

Open
ahadb opened this issue May 14, 2024 · 1 comment
Open

Stumped - Cannot Access API Methods in React Using gridRef #7965

ahadb opened this issue May 14, 2024 · 1 comment

Comments

@ahadb
Copy link

ahadb commented May 14, 2024

I'm submitting a ... (check one with "x")

[] bug report => see 'Providing a Reproducible Scenario'
[] feature request => do not use Github for feature requests, see 'Customers of AG Grid'
[x] support request => see 'Requesting Community Support'

Requesting Community Support

Hi, I am a customer of AG Grid having purchased a license for Nomura Securities and I need some help please till I get registered for Zen Desk support.

Till then I have an issue that I need to ask everyone, can someone please help.

Providing a Reproducible Scenario

I cannot get access to simple Grid API methods like forEachNode and none of the other methods are available to me listed on the docs. The grid has loaded and I can see the API using gridRef.current.api (just none of the methods are available to me).

I can see the the Service objects but none of the methods are available in those objects either. I do see them on the prototype (BeanStub), but when trying to access them I still cannot. Also the API from params via the callback functions are not available either alongside with my first issue above.

  • Enterprise version 30.0.0 (set license key provided by info@ag-grid.com)
  • React version 16.11.0
  • Ag Grid modules:
    "@ag-grid-community/core": "30.0.0",
    "@ag-grid-enterprise/core": "30.0.0",
    "@ag-grid-enterprise/row-grouping": "30.0.0",
    "@ag-grid-community/react": "30.0.0",
    "@ag-grid-community/styles": "30.0.0",
    "@ag-grid-community/client-side-row-model": "30.0.0",
    "@ag-grid-enterprise/column-tool-panel": "30.0.0",
    "@ag-grid-enterprise/filter-tool-panel": "30.0.0",
    "@ag-grid-enterprise/set-filter": "30.0.0",
    "@ag-grid-enterprise/side-bar": "30.0.0",
  • Using a ref attached to the grid
    <AgGridReact
    ref={gridRef}
    // ...
  • Checking gridRef.current.api
  • Browser: Microsoft Edge Version 124.0.2478.80

Accessing the API should be the simplest of things for me to achieve. Can some help if they have seen this issue before, I have tried everything and am stumped.

Thanks.

@StephenCooper
Copy link
Member

Sounds like very odd behaviour and not something we have heard of before. Things I would try:

  • try a different version of AG Grid which will also validate against any bad installation
  • check if the API instance has been destroyed if so sounds like something is destroying the component before you can use it
  • add the debug flag and see if one of the properties passed into the grid is causing it to constantly re-render. If this is happening make sure to use the appropriate hook to avoid that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants