DropDownTreeComponent - value primitive error

1 Answer 63 Views
DropDownTree
Link
Top achievements
Rank 1
Link asked on 01 Aug 2023, 10:38 AM

Hi!

I'm using the dropdowntreecomponent with value primitive binding to ngmodel but I get an error when opening the dropdown.

Here is a sandbox showing the error:
https://codesandbox.io/s/empty-field-s3vtcr

ERROR Error: Expected dataItem of type Object to be set. See https://www.telerik.com/kendo-angular-ui/components/dropdowns/api/DropDownTreeComponent/#toc-dataitem

Basically the dataItem is received here as a primitive value and not the complete dataItem.

Thanks

 

1 Answer, 1 is accepted

Sort by
0
Tsvetelina
Telerik team
answered on 04 Aug 2023, 08:18 AM

Hi Link,

Thank you for the provided example.

The error you are getting is caused because the dataItem property is missing. It has to be provided when valuePrimitive is set to true. I added it to the CodeSandbox example and the error is resolved: 

https://codesandbox.io/s/determined-knuth-dwdt6c?file=/src/app/app.component.ts

I hope this helps.

Regards,
Tsvetelina
Progress Telerik

Stay tuned by visiting our public roadmap and feedback portal pages! Or perhaps, if you are new to our Kendo family, check out our getting started resources
Tags
DropDownTree
Asked by
Link
Top achievements
Rank 1
Answers by
Tsvetelina
Telerik team
Share this question
or