Hi,
I have a situation where I am setting the dataSource of a dropdowntree after defining it (using the setDropDown method). Howerver, I can't seem to be able to clear values from the dropdowntree in this scenario.
I tried to replicate the problem best I could in this dojo: https://dojo.telerik.com/iKoBOVIk/3
Upon selecting item 1 and item 2, if I click the button I want the selected values to be cleared. How can I achieve this?
Thanks.
3 Answers, 1 is accepted
Hello Roohi,
This behavior is due to a known bug of the DropDownTree when using its setDataSource method. See this Github issue for more details.
Regards,
Ivan Danchev
Progress Telerik
Hi,
Just wanted to let you know that I found a fix by using the kendo HierarchicalDataSource instead of a normal array to pass into the setDataSource function.
Here's an updated version of the previous demo that uses the fix: https://dojo.telerik.com/iKoBOVIk/5
Thanks for your time!
Hi Roohi,
Actually even if you pass HierarchicalDataSource to the setDataSource method the issue will still be reproducible: dojo example.
The scenario would be: the DropDownTree already has a dataSource set. Some of the items are selected and then you set a new dataSource. The previously selected items are not cleared. The workaround is to clear the value before setting the new dataSource:
dropdowntree.value([]);
dropdowntree.setDataSource(test_dataSource);
Regards,
Ivan Danchev
Progress Telerik
Hello, Lee,
Could you please modify the example provided by my colleague to reproduce the issue?
Hello, Lee,
Here is the modified example to prevent triggering the events.