2012-10-02 119 views
1

我正在嘗試使用Kendo TreeView,並且我絕對沒有綁定到本地數據源的運氣。我有一個簡單的asp.net網頁表單頁面,我複製並粘貼了在線演示的代碼,但是我沒有做任何事情會使這個工作。有任何想法嗎?需要幫助將Kendo TreeView綁定到本地數據源

<html xmlns="http://www.w3.org/1999/xhtml"> 
<head runat="server"> 
    <title>Kendo TreeView Demo</title> 
    <link href="styles/kendo/kendo.common.min.css" rel="stylesheet" /> 
    <link href="styles/kendo/kendo.default.min.css" rel="stylesheet" /> 
    <style type="text/css"> 
     * { font-family: "Segoe UI", Arial, Helvetica, Sans-Serif; font-size: 12px; } 
    </style> 
    <script type="text/javascript" src="scripts/jquery.min.js"></script> 
    <script type="text/javascript" src="scripts/kendo/kendo.all.min.js"></script> 
    <script type="text/javascript" src="scripts/kendo/kendo.data.min.js"></script> 
    <script type="text/javascript"> 
     $(document).ready(function() 
     { 
      var inlineDefault = new kendo.data.HierarchicalDataSource(
      { 
       data: 
       [ 
        { 
         text: "Furniture", 
         items: 
         [ 
          { text: "Tables & Chairs" }, 
          { text: "Sofas" }, 
          { text: "Occasional Furniture" } 
         ] 
        }, 
        { 
         text: "Decor", 
         items: 
         [ 
          { text: "Bed Linen" }, 
          { text: "Curtains & Blinds" }, 
          { text: "Carpets" } 
         ] 
        } 
       ] 
      }); 

      $("#treeview-left").kendoTreeView(
      { 
       dataSource: inlineDefault 
      }); 
     }); 
    </script> 
</head> 
<body> 
    <form id="form1" runat="server"> 
    <div> 
     <div id="treeview-left"></div> 
    </div> 
    </form> 
</body> 
</html> 

回答

1

您已包括應除去,因爲後者包含前者的內容kendo.all.min.js後kendo.data.min.js。

這裏是工作示例:http://jsbin.com/icojuv/1/edit