We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Can't set selected value programmatically

Hi, 

I can't get to work the set value programmatically for the dropdown tree.


Here is my test code :  https://stackblitz.com/edit/gwmvf2?file=index.js


If  can tell me what I'm doing wrong,


Thank you 


1 Reply

IL Indhumathy Loganathan Syncfusion Team March 28, 2023 03:11 PM UTC

Hi Ecaldima,


Greetings from Syncfusion support.


You can set selected value to the Dropdown Tree component dynamically using the value property. You need to set the id values as a string[]. Check out the modified code below.


setTimeout(function () {

  ddTreeObj.value = ['01-01'];

  console.log('done');

}, 3000);


Sample: https://stackblitz.com/edit/gwmvf2-frferu?file=index.js


Check out the shared sample and get back to us if you need any further assistance.


Regards,

Indhumathy L


Loader.
Up arrow icon