This is a migrated thread and some comments may be shown as answers.

checked all checkboxes of kendo dropdowntree by default

4 Answers 766 Views
DropDownTree
This is a migrated thread and some comments may be shown as answers.
yolo
Top achievements
Rank 1
Veteran
yolo asked on 02 Mar 2021, 02:39 AM

Hi, 

i have a drop down tree created, as shown in the attachment below

i need to checked all the checkboxes by default. How to do this?

4 Answers, 1 is accepted

Sort by
0
yolo
Top achievements
Rank 1
Veteran
answered on 02 Mar 2021, 02:59 AM

or how can i let the filter reflects on what are the type of events(holidays, interview,etc) that are present in the view?

for instance, in that week view, i only have events and holidays, and i wan the dropdowntree to automatically checked the events and holidays checkboxes.

0
Petar
Telerik team
answered on 04 Mar 2021, 09:57 AM

Hi Yolo,

You can pre-select the items in the DropDownTree by setting the "expanded" property in the datasource of the component. Here is a Dojo example demonstrating the targeted functionality. The datasource of the DropDownTree in the example is defined as follows. The configuration in yellow will initially check the items that have the "checked" property in their datasource. 

dataSource: [
    {
        text: "Furniture", checked: true, expanded: true, items: [
            { text: "Tables & Chairs", checked: true },
            { text: "Sofas", checked: true },
            { text: "Occasional Furniture", checked: true }
        ]
    },
    {
        text: "Decor", checked: true, items: [
            { text: "Bed Linen", checked: true },
            { text: "Curtains & Blinds", checked: true },
            { text: "Carpets"}
        ]
    }
]

Let me know if the suggested solution works in your scenario.

Regards,
Petar
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

0
yolo
Top achievements
Rank 1
Veteran
answered on 05 Mar 2021, 08:41 AM

Hi Petar, thanks for the reply. 

However, im implementing this dropdowntree for the types of event in my scheduler.

 

When i navigate to the next week, the scheduler will show all the events, but the dropdown tree doesn't adapt to the type of event that are being rendered in the scheduler. For instance, i only have checkbox "holidays" checked and all other type of events unchecked for the current week, when i navigate to the next week, the scheduler will show all the events but still remains the same whereby "holidays" are being checked.

also, how the checked the "check all" checkbox by default and have the value for each checkbox to be save in the 

$('dropdowntree').data("kendoDropDownTree").values()

0
Petar
Telerik team
answered on 10 Mar 2021, 07:09 AM

Hi Yolo,

I am afraid that based only on the provided information I can't say what is happening in your application. The way you use the DropDownTree seems to be a complex scenario and to be able to help you, I will need a runnable example in which the reported behavior can be replicated. When I test your scenario locally, I can provide more relevant feedback. 

Can you edit this Dojo example in a way the reported behavior can be replicated and send me the edited project back? 

Regards,
Petar
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
DropDownTree
Asked by
yolo
Top achievements
Rank 1
Veteran
Answers by
yolo
Top achievements
Rank 1
Veteran
Petar
Telerik team
Share this question
or