You can change it with the treeview's text
method, or by setting the property on the data item:
var tree = $("#treeview").kendoTreeView({
dataSource: inlineDefault,
loadOnDemand: false
}).data("kendoTreeView");
// change using treeView.findByText and treeView.text
$("#change").click(function () {
var searchString = "Sofas";
$(tree.findByText(searchString)).each(function () {
tree.text(this, "Thrones");
});
});
// change using the data source
$("#change2").click(function () {
var searchString = "Sofas";
var dataItem = tree.dataSource.data()[0].items[1];
dataItem.set("text", "Thrones");
});
You'll need to set the loadOnDemand
option to false to search the tree, because otherwise the DOM elements are only created when the relevant branch is expanded.
(demo)