or
[{ id:'2022', text:'Folder1', items: [{ id:'3202', text:'Sub-Folder1' }, { id:'1234', text:'Sub-Folder2', moo: true }]}]var liElement = $('#treeView').data('kendoTreeView').search({id:'3202'});var liElement = $('#treeView').data('kendoTreeView').search({id:'1234', moo: true});$("#scenegraph-treeview").data('kendoTreeView').search = function (json, source) { if (json !== undefined) { var data = source || this.dataSource, child, item, i, k, match, allMatched; // If the data has the properties we need if (data && data._data) { child = data._data; // If the array has items if (child.length) { // Loop the array items for (i = 0; i < child.length; i++) { item = child[i]; console.log('Checking child ' + i + ' id ' + item.id); // Check each json property against the current item's properties // and if they all match, grab the tree item based on it's UID allMatched = true; for (k in json) { if (json.hasOwnProperty(k)) { if (item[k] !== json[k]) { // The item doesn't have all the properties // that the json object does allMatched = false; break; } } } if (allMatched) { // We've found a match, grab the tree item from the UID and return it return this.findByUid(item.uid); } else { // We didn't find what we were looking for so search the children if (item.children) { match = this.search(json, item.children); if (match) { return match; } } } } } } }};