Is there a way to select a node by default in a Treelist ? eg :if a node has "selected" set to true in the datasource, kendo will automatically select the node.
If not, How can I select a node programmatically in a Treelist ?
I've searched on the internet , all the results that I've found are about TreeView.
I've tried the same method as in treeView, but there is not a method named "findByUid"
"onSelect": function (e) {
var selectedRows = this.select();
var selectedDataItems = [];
for (var i = 0; i < selectedRows.length; i++) {
var dataItem = this.dataItem(selectedRows[i]);
if (!dataItem.selectable)
{
//hack
//For now, a treelist doesn't allow you to prevent the selection
//as it is done in a treeview (e.preventdefault).So in order
// to prevent the selection we must do a little hack using css.
selectedRows.removeClass("k-state-selected");
}
//test
e.sender.select(e.sender.findByUid(2));
treeview.select(selectitem);
}