or
<script> $("#treeview-left, #treeview-right").kendoTreeView({ dragAndDrop: true, dataSource: [ { text: "Item 1", expanded: true, items: [ { text: "Item 1.1" }, { text: "Item 1.2" }, { text: "Item 1.3" } ] }, { text: "Item 2", items: [ { text: "Item 2.1" }, { text: "Item 2.2" }, { text: "Item 2.3" } ] }, { text: "Item 3" } ] }).data("kendoTreeView");</script><script> $("#treeview-left, #treeview-right").kendoTreeView({ dragAndDrop: true, dataSource: { transport: { read: { url: "/site/GetTreeData.action", dataType: "json" } } } }).data("kendoTreeView");</script>[
{ text: "Item 1", expanded: true, items: [ { text: "<a href='http://localhost:8080/site/GetEmployee.action'>clear here</a>", encoded: false }, { text: "Item 1.2" }, { text: "Item 1.3" }] },{ text: "Item 2", items: [ { text: "Item 2.1", items: [ { text: "Item 2.1.1" }, { text: "Item 2.1.2" } ] }, { text: "Item 2.2" }, { text: "Item 2.3" }] },{ text: "Item 3" }]If I paste the previous JSON string inside the page and reload it, the tree displays just fine.
So, what am I doing wrong?
<title>Tree View</title> <link href="shared/styles/examples-offline.css" rel="stylesheet"><link href="styles/kendo.common.min.css" rel="stylesheet"><link href="styles/kendo.blueopal.min.css" rel="stylesheet"><script src="js/jquery.min.js"></script><script src="js/kendo.web.min.js"></script><script src="shared/js/console.js"></script></head><body> <div id="example" class="k-content"> <div id="treeview" class="demo-section"></div> <script> var ds = new kendo.data.DataSource({ transport: { read: { url:"http://localhost:8080/OnTheSpotRestfullAPI/testTree.xml" } }, schema: { type: "xml", data: "/tree/vehicles", model: { fields: { car: "car/text()", bike: "bike/text()" } } } }); $("#treeview").kendoTreeView({ dataSource: ds }); </script> <style scoped> #example { text-align: center; } .demo-section { display: inline-block; vertical-align: top; width: 320px; height: 300px; text-align: left; margin: 0 2em; } </style> </div></body></html><?xml version="1.0" encoding="UTF-8" standalone="yes"?><tree> <vehicles> <car>FM-1100</car> <car>FM-4200</car> <bike>FM-3100</bike> </vehicles> <personnel> <client>GH-3000</client> <vip>GH-3100</vip> </personnel></tree><ul data-role="actionsheet" id="inboxActions" data-open="onOpen" data-popup='{"direction": "left"}'> <li class="km-actionsheet-title">Monday Meeting:</li> <li><a href="#" data-action="reply">Reply</a></li> <li><a href="#" data-action="replyAll">Reply All</a></li> <li><a href="#" data-action="archive">Archive</a></li></ul><ul data-role="actionsheet" id="inboxActions" data-open="onOpen" data-popup='{"direction": "left"}'> <li class="km-actionsheet-title">Monday Meeting:</li> <li><a href="#" data-action="singleEventHandler">Reply</a></li> <li><a href="#" data-action="singleEventHandler">Reply All</a></li> <li><a href="#" data-action="singleEventHandler">Archive</a></li></ul>function singleEventHandler(e) { if (<some test involving e>) { $("#actionResult").html("Replying to message #" + e.context); } else if (<some other test involving e>) { $("#actionResult").html("Replying to all in message #" + e.context); } else if (<some other test involving e>) { $("#actionResult").html("Archiving message #" + e.context); }
doMoreStuff();}columns.Bound(p => p.URL).Title("Url").Visible(false);columns.Template(p => p.TRACKINGNUMBER).ClientTemplate( "<a href='#= URL #'>#= TRACKINGNUMBER #</a>" ).Title("Tracking Number");<li data-bind="invisible: #= console.log(this) #"> <span>test</span></li>Fires when the drop-down list has received data from the data source.
$("#dropdownlist").kendoDropDownList({
dataBound: function(e) {
// handle event
}
});
// get a reference to the dropdown list
var dropdownlist = $("#dropdownlist").data("kendoDropDownList");
// bind to the close event
dropdownlist.bind("dataBound", function(e) {
// handle event
});