or
<script> $(document).ready(function () { var crudServiceBaseUrl = "http://demos.kendoui.com/service", dataSource = new kendo.data.DataSource({ transport: { read: { url: crudServiceBaseUrl + "/Products", dataType: "jsonp" }, update: { url: crudServiceBaseUrl + "/Products/Update", dataType: "jsonp" }, destroy: { url: crudServiceBaseUrl + "/Products/Destroy", dataType: "jsonp" }, create: { url: crudServiceBaseUrl + "/Products/Create", dataType: "jsonp" }, parameterMap: function(options, operation) { if (operation !== "read" && options.models) { return {models: kendo.stringify(options.models)}; } } }, batch: true, pageSize: 30, schema: { model: { id: "ProductID", fields: { ProductID: { editable: false, nullable: true }, ProductName: { validation: { required: true } }, UnitPrice: { type: "number", validation: { required: true, min: 1} }, Discontinued: { type: "boolean" }, UnitsInStock: { type: "number", validation: { min: 0, required: true } } } } } }); $("#grid").kendoGrid({ dataSource: dataSource, navigatable: true, pageable: true, height: 400, toolbar: ["create", "save", "cancel"], columns: [ "ProductName", { field: "UnitPrice", title: "Unit Price", format: "{0:c}", width: 150 }, { field: "UnitsInStock", title: "Units In Stock", width: 150 }, { field: "Discontinued", width: 100 }, { command: "destroy", title: " ", width: 110 }], editable: true }); }); </script> var window = $("#window");
window.kendoWindow({ width: "505px", height: "315px", title: "Mail", actions: ["Refresh", "Maximize", "Close"], content:"inbox/getemail.aspx?msgid="+msgid, iframe:false }); window.data("kendoWindow").open();script language="javascript">var messageData;$.fn.getMessageData = function(){ messageData = { time:'2012-07-26 12:34:50', sender:'test@test.com', subject:'Testing message data' };};$(function(){ var template = kendo.template($("#template").html()); $.fn.getMessageData(); $("#preview").html(template(messageData)); });</script><script type="text/x-kendo-template" id="template"> <h3>#= subject #</h3> <h4>posted on #= time # by <strong>#= sender #</strong></h4> </script> <div id="preview"></div>[{ 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; } } } } } } }};