Hello,
It is pretty simple, just use the checkbox template, a bit of css and javascript.
I have uploaded a sample here:
Kendo UI® Dojo by Progress[
^]
First in CSS define two class to show or hide the box:
<style type="text/css">
.txtBoxHidden{
display:none;
}
.txtBoxVisible{
display:inline;
}
</style>
Then in the script loading the tree add a little javaScript:
<script>
$("#treeview").kendoTreeView({
checkboxes: {
template: "<input type='checkbox' name='checkedFiles[#= item.id #]' value='true' id='#= item.id #' /><input type='text' class='txtBoxHidden' id='txtEditBox#= item.id #'/>"
},
dataSource: [
{ id: 1, text: "foo", items: [
{ id: 2, text: "bar" }
] }
]
});
$(':checkbox').change(function() {
var id = 'txtEditBox' + $(this).attr('id');
var className = document.getElementById(id).className;
if (className == 'txtBoxHidden') {
document.getElementById(id).className = 'txtBoxVisible';
}
else {
document.getElementById(id).className = 'txtBoxHidden';
}
});
</script>
Tada!
Valery