typescript - How to fetch agSelectCellEditor or agRichSelectCellEditor values from a service per API call - Stack Overflow

admin2025-04-09  0

i would like to set the values used for selecting a column value using agRichSelectCellEditor to data fetched from an api call. If i set the value to const value, it works, but when i use values fetched per api call using useState and useEffect it does not work

const [data, setData]=useState<string>([])

    cellEditor: "agRichSelectCellEditor",
    singleClickEdit : true,
    editable: true,
    cellEditorParams: {
     values: ['English', 'Spanish', 'French', 'Portuguese', '(other)'], <== this works
     }

cellEditor: "agRichSelectCellEditor",
singleClickEdit : true,
editable: true,
cellEditorParams: {
 values: data, <== this does not works
 }
转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1744202190a235850.html

最新回复(0)