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

enable/disable checkbox

3 Answers 383 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Francesco
Top achievements
Rank 1
Francesco asked on 16 Jan 2013, 01:25 PM
Hi,
Can i enable/disable checkbox of an item from a parametrer passed in the datasource?

for example:
i set my treeview with: 
checkboxes: {
                    checkChildren: true
                },
in the:
   dataSource: [{ ... }]

can i pass a parametrer for set the checkbox disable on that item? (or i can do not show a checkbox for that item)

thank you




3 Answers, 1 is accepted

Sort by
0
Alex Gyoshev
Telerik team
answered on 16 Jan 2013, 02:34 PM
Hello Francesco,

Both behaviors can be achieved by using a checkbox template:

checkboxes: {
    checkChildren: true,
    template: kendo.template(
        "# if (item.checkable !== false) { #" +
            "<input type='checkbox' #= item.checked ? 'checked' : '' # />" +
        "# } #"
    )
}

Greetings,
Alex Gyoshev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Francesco
Top achievements
Rank 1
answered on 16 Jan 2013, 02:41 PM
thank you

if i click on the checkbox the value on the datasource is modified? 

because i must to show in a table the selected checkboxes in real time.
0
Accepted
Alex Gyoshev
Telerik team
answered on 16 Jan 2013, 02:49 PM
Hello Francesco,

Yes, this functionality has been introduced in the 2012.Q3 release. If you need help with a specific scenario, please supply a sample project or a jsBin example so that we can help with that.

Greetings,
Alex Gyoshev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
TreeView
Asked by
Francesco
Top achievements
Rank 1
Answers by
Alex Gyoshev
Telerik team
Francesco
Top achievements
Rank 1
Share this question
or