Unable to change selected value on certain action

Hi Team,

I am trying to use ejs-dropdowntree but unable to change value on certain actions. I have three levels of data

  public categoryList: { [keystring]: Object }[] = [
    {
      nodeId: '0',
      nodeText: 'All Categories',
    },
    {
      nodeId: '3',
      nodeText: 'Automative Vehicles',
    },
    {
      nodeId: '2',
      nodeText: 'Properties',
      expanded: false,
    },
    {
      nodeId: '1',
      nodeText: 'Jobs',
      expanded: true,
      nodeChild: [
        { nodeId: '14'nodeText: 'Accounting & Finance Jobs' },
        { nodeId: '15'nodeText: 'Advertising & Marketing Jobs' },
        { nodeId: '16'nodeText: 'Arts & Entertainment Jobs' },
        { nodeId: '17'nodeText: 'Au Pair & Babysitting Jobs' },
        { nodeId: '18'nodeText: 'Admin Jobs' },
        {
          nodeId: '19'nodeText: 'IT & Tech Jobs'expanded: true,
          nodeChild: [
            { nodeId: '79'nodeText: 'IT Technician Jobs' },
            { nodeId: '80'nodeText: 'Software & Web Developer Jobs' },
            { nodeId: '81'nodeText: 'Graphic Design Jobs' },
            { nodeId: '82'nodeText: 'Web Designers Jobs' }
          ]
        },
      ],
    },
  ];

initially value is set as public value: string = '0';

On some action i changed it to this.value = 80; which doesnt work


Regards,
Ravindra

3 Replies

SP Sowmiya Padmanaban Syncfusion Team June 2, 2020 11:57 AM UTC

Hi Ravindra,  
 
Greetings from Syncfusion support. 
 
We have checked your reported problem with TreeView component. We are unable to reproduce your issue. When changing of value of DropdownTree using value property , it works properly. We would like to let you know that value property is a string array. We suspect that your reported issue occurs due to you have declared the value property as integer .For your reference, we have changed the value of DropdownTree using button click. 
 
Refer the below code snippet. 
  Changevalue() { 
        this.ddTreeObj.value =['80']; 
    } 

Refer the sample link below. 
 
Refer the below link to know more about the DropDownTree. 
 
 
 
Please let us know, if you have need any further assistance. 
 
Regards,  
Sowmiya. P 
 



RA Ravindra June 2, 2020 01:14 PM UTC

Hi Sowmiya,

Thank you, it worked yes i was doing it wrong, didn't know its an array.

Regards,


SP Sowmiya Padmanaban Syncfusion Team June 3, 2020 04:22 AM UTC

Hi Ravindra,  
  
Most Welcome. We are happy to hear that your problem has been resolved. Please contact us, if you need any help from us. 
  
Regards,  
Sowmiya.P 


Loader.
Up arrow icon