Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to apply auto-complete functionality to the cell of ag-grid?

Auto-complete functionality needs to suggest function names which is in a json format and mentioned below:

{
 "id": 260,
 "title": "p_active(Power: number, PowerAngle: number)",
 "type": "PR",
 "category": "AL",
 "structure": "p_active(Power: number, PowerAngle: number)"
}

Here, p_active is a function name, which needs to be included in the suggestion.

like image 817
Ritika Avatar asked Oct 29 '25 02:10

Ritika


1 Answers

I don't think ag-grid has support for autocomplete out of the box, with that being said there are 2 possible solutions I can think of:

  1. Create a custom Cell Renderer component. This allows you to customize your cell with any component however you want, in this case what you can do is have an input there with auto complete. More info about this: https://www.ag-grid.com/javascript-grid-cell-rendering-components/

  2. Use a ready solution/package - here's a package I found: https://www.npmjs.com/package/ag-grid-autocomplete-editor

Here's a stackblitz with the implementation of autocomplete: https://stackblitz.com/edit/ag-grid-autocomplete-editor

like image 93
Yair Cohen Avatar answered Oct 30 '25 17:10

Yair Cohen