DropDownTree Wrapper component, how to save value?

1 Answer 110 Views
DropDownTree wrapper
Vincent
Top achievements
Rank 3
Iron
Iron
Iron
Vincent asked on 19 Oct 2021, 11:54 AM

How do I save the value from this dropdowntree component onChange?:

https://www.telerik.com/kendo-vue-ui/components/dropdowntree-wrapper/

 

With the multiselect and dropdownlist components I can use

e.sender.dataItems();

and 

e.sender.dataItem(e.sender.select());

respectively

 

But for the dropdowntree component there isnt't a dataItem attached to the event sender object.

1 Answer, 1 is accepted

Sort by
1
Accepted
Plamen
Telerik team
answered on 20 Oct 2021, 06:10 AM

Hello,

You can use the e.sender.value() method in the change event of the DropDownTree component to get the new selected value as for example it is done in this example - https://stackblitz.com/edit/syqrvj?file=src/main.vue

Regards,
Plamen
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Vincent
Top achievements
Rank 3
Iron
Iron
Iron
commented on 20 Oct 2021, 07:16 AM

Thank you for your answer, I have one more question:

Does the initial value of the dropdowntree only support a flat array of (in this case) id's? Or is it also possible to use an array of objects as the initial value?

https://stackblitz.com/edit/syqrvj?file=src/main.vue
Plamen
Telerik team
commented on 20 Oct 2021, 01:02 PM

With the current version you can't use array objects as initial values yet you can set a custom data-value-field and and use it as a field for the values as it is done in this example - https://stackblitz.com/edit/syqrvj-6jacub?file=src/main.vue

 

 
Tags
DropDownTree wrapper
Asked by
Vincent
Top achievements
Rank 3
Iron
Iron
Iron
Answers by
Plamen
Telerik team
Share this question
or