DropDownList - Get only the ID and not the whole object

2 Answers 514 Views
DropDownList
Rafael
Top achievements
Rank 1
Rafael asked on 15 Oct 2021, 12:41 AM | edited on 15 Oct 2021, 12:43 AM
I need to find a way to just capture the dropdown id, I don't want the whole object like this in my output.

Which prop can I use to capture just my selection ID?
For example in a traditional HTML select can I ?
I can't believe kendo doesn't have this solution 


<DropDownList
textField={"description"}
  dataItemKey={"id"}
  value={form?.importLevelId}
  onChange={(evt) => {
  lists.importLevelId = evt.target.value;
  setForm({ ...form, importLevelId: evt.target.value });
  }}
  data={integrationSetupCombos?.importLevels}/>

My output:

importLevelId:
description"Tactic"
id1



2 Answers, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 15 Oct 2021, 02:12 PM

Hello, Rafael,

If the ID is needed the developer can get the ID directly from the object:

https://stackblitz.com/edit/react-md4etx?file=app/main.jsx

We can return only the ID, but then another developer may need the entire object.

Regards,
Stefan
Progress Telerik

Remote troubleshooting is now easier with Telerik Fiddler Jam. Get the full context to end-users' issues in just three steps! Start your trial here - https://www.telerik.com/fiddler-jam.
0
Tejas
Top achievements
Rank 2
Iron
Iron
Iron
answered on 02 May 2023, 06:25 AM
Please implement a dropdown list with send id in use a kendo form and and edit a value for after show a label name in dropdown list .
Wissam
Telerik team
commented on 03 May 2023, 02:33 PM

Hi, Tejas,

Could you please provide me with more information on the needed functionalities?

Regarding the DropDownList in the KendoReact Form, where do you want to pass the id values of the items? In addition, I understood that you want to enable editing in the component. Is this correct? If this is the case, it will also be helpful if you could tell me your requirements for this implementation. For example, do you want the editing to be done externally, by double-clicking the items, or do you need something different?

I will be waiting for your reply and will be glad to assist you further.

Regards,
Wissam
Progress Telerik
Tags
DropDownList
Asked by
Rafael
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Tejas
Top achievements
Rank 2
Iron
Iron
Iron
Share this question
or