All Telerik .NET tools and Kendo UI JavaScript components in one package. Now enhanced with:
Hi,
I am using AutoComplete with the below code:
<AutoComplete data={this.state.DataSet2.map(item => item.name)} />
It is working and I need to pass id of the selected text to backend, where Dataset2 contains both id and name. But here just getting the text.
Regards
Hello, Neethu,
Currently, the AutoComplete will only return the text as its value.
There are two options in this case:1) Based on the text value to extract the ID by looping thought the collection.
2) Use the ComboBox component with the suggest property and it will behave as an AutoComplete and it will return the object as value with the ID:https://www.telerik.com/kendo-react-ui/components/dropdowns/combobox/suggestions/
Make sure to pass the data as objects as well, as otherwise, the component will not have access to it:https://www.telerik.com/kendo-react-ui/components/dropdowns/combobox/binding/#toc-datasets-of-objects
I hope one of the options to prove helpful.
Regards, Stefan Progress Telerik