6 Answers, 1 is accepted

anyone?
Hi Vasiliki,
I have tested the Dojo sent in Chrome, IE, Firefox, and Edge. In all browsers, the A and C items are properly checked with no errors observed. Attached you will find a short video of running the sample.
May I ask you to explain a bit in detail what is the issue faced? A short screencast demonstrating the problem would also be very helpfull.
Regards,
Veselin Tsvetanov
Progress Telerik


Maybe its because there are children as well in the structure?
Can you do a dojo example with children included in the datasource?
Hello Vasiliki,
If you need to check items deeper in the hierarchy of the TreeView, you will have to do that when those items are already loaded. Having that said, the check logic should be moved to the dataBound event of the TreeView:
dataBound: function(e) {
var tv = e.sender;
var tvDataItems;
var values = ["A", "C"];
if(!e.node) {
tvDataItems = tv.dataItems();
} else {
tvDataItems = e.sender.dataItem(e.node).children.data();
}
tvDataItems.forEach(function(dataItem) {
if (values.indexOf(dataItem.text) > -1) {
dataItem.set("checked", true);
}
});
}
Here is a modified version of the Dojo discussed: http://dojo.telerik.com/AqEpIViJ/6
Regards,
Veselin Tsvetanov
Progress Telerik
