Hi, how do i add custom inputs (or other things) to the treeview?
I tried doing text ="<input..." but that doesn't work, and I tried just passing back my JSON with an extra param (ie id: 1, text:"...", myparam: "myvalue") and that gave an error.
Here's what I tried:
$("#treeview").kendoTreeView({
dataSource: [{
id: 1, text: "<input type='hidden' value='val' />My Documents", expanded: true, spriteCssClass: "rootfolder", items: [
{
id: 2, myparam:2, text: "Kendo UI Project", expanded: true, spriteCssClass: "folder", items: [
{ id: 3, text: "about.html", spriteCssClass: "html" },
{ id: 4, text: "index.html", spriteCssClass: "html" },
{ id: 5, text: "logo.png", spriteCssClass: "image" }
]
},
{
id: 6, text: "New Web Site", expanded: true, spriteCssClass: "folder", items: [
{ id: 7, text: "mockup.jpg", spriteCssClass: "image" },
{ id: 8, text: "Research.pdf", spriteCssClass: "pdf" },
]
},
{
id: 9, text: "Reports", expanded: true, spriteCssClass: "folder", items: [
{ id: 10, text: "February.pdf", spriteCssClass: "pdf" },
{ id: 11, text: "March.pdf", spriteCssClass: "pdf" },
{ id: 12, text: "April.pdf", spriteCssClass: "pdf" }
]
}
]
}]
});
I tried doing text ="<input..." but that doesn't work, and I tried just passing back my JSON with an extra param (ie id: 1, text:"...", myparam: "myvalue") and that gave an error.
Here's what I tried:
$("#treeview").kendoTreeView({
dataSource: [{
id: 1, text: "<input type='hidden' value='val' />My Documents", expanded: true, spriteCssClass: "rootfolder", items: [
{
id: 2, myparam:2, text: "Kendo UI Project", expanded: true, spriteCssClass: "folder", items: [
{ id: 3, text: "about.html", spriteCssClass: "html" },
{ id: 4, text: "index.html", spriteCssClass: "html" },
{ id: 5, text: "logo.png", spriteCssClass: "image" }
]
},
{
id: 6, text: "New Web Site", expanded: true, spriteCssClass: "folder", items: [
{ id: 7, text: "mockup.jpg", spriteCssClass: "image" },
{ id: 8, text: "Research.pdf", spriteCssClass: "pdf" },
]
},
{
id: 9, text: "Reports", expanded: true, spriteCssClass: "folder", items: [
{ id: 10, text: "February.pdf", spriteCssClass: "pdf" },
{ id: 11, text: "March.pdf", spriteCssClass: "pdf" },
{ id: 12, text: "April.pdf", spriteCssClass: "pdf" }
]
}
]
}]
});