2016-09-30 14 views
0

チェックボックスの剣道ツリービューを角張って実装しています。私はエラーは出ませんが、ツリーはレンダリングされません。私のコードはここにある:剣道角度のjsで動作しないチェックボックスのツリービュー

addCtrl.js

$scope.updateTree = function() { 
    websiteService.getWebsiteFeaturesTree(webName, function (data) { 
       $scope.treeOptions = { 
        checkboxes: { 
         checkChildren: true 
        } 
       }; 

       $scope.treeDataSource = data; 
      }); 

    } 

add.html

<div kendo-tree-view k-options="treeOptions" k-data-source="treeDataSource"></div> 

app.js

var app = angular.module('app', ['ui.bootstrap', 'ngRoute', 'kendo.directives']); 

私はdataso取得しますウェブサービスからの要請。ここにjsonです

// 20160930204148 
// http://localhost/api/Website/GetWebsiteFeaturesTree?webName=MetisEmptyTemplate 

[ 
    { 
    "Name": "Section", 
    "text": "Admin", 
    "checked": false, 
    "items": [ 
     { 
     "Name": "Tab", 
     "text": "Matrix Analysis", 
     "checked": true, 
     "items": [ 

     ] 
     }, 
     { 
     "Name": "Tab", 
     "text": "Risk Categories and Questions", 
     "checked": true, 
     "items": [ 

     ] 
     }, 
     { 
     "Name": "Tab", 
     "text": "Risk Colors", 
     "checked": true, 
     "items": [ 

     ] 
     }, 
     { 
     "Name": "Tab", 
     "text": "SWOT Types", 
     "checked": false, 
     "items": [ 

     ] 
     } 
    ] 
    }, 
    { 
    "Name": "Section", 
    "text": "Strategy", 
    "checked": false, 
    "items": [ 
     { 
     "Name": "Tab", 
     "text": "SWOT Analysis", 
     "checked": false, 
     "items": [ 
      { 
      "Name": "Grid", 
      "text": "SWOT Grid", 
      "checked": true, 
      "items": [ 

      ] 
      }, 
      { 
      "Name": "Outputs", 
      "text": "Outputs", 
      "checked": false, 
      "items": [ 
       { 
       "Name": "Output", 
       "text": "SWOT Box", 
       "checked": false, 
       "items": [ 

       ] 
       } 
      ] 
      } 
     ] 
     } 
    ] 
    }, 
    { 
    "Name": "Section", 
    "text": "Portfolio", 
    "checked": true, 
    "items": [ 
     { 
     "Name": "Tab", 
     "text": "Matrix", 
     "checked": true, 
     "items": [ 
      { 
      "Name": "Grid", 
      "text": "Matrix Grid", 
      "checked": true, 
      "items": [ 

      ] 
      }, 
      { 
      "Name": "Outputs", 
      "text": "Outputs", 
      "checked": true, 
      "items": [ 
       { 
       "Name": "Output", 
       "text": "Matrix Output", 
       "checked": true, 
       "items": [ 

       ] 
       } 
      ] 
      } 
     ] 
     }, 
     { 
     "Name": "Tab", 
     "text": "Strategy", 
     "checked": true, 
     "items": [ 
      { 
      "Name": "Grid", 
      "text": "Strategy Grid", 
      "checked": true, 
      "items": [ 

      ] 
      }, 
      { 
      "Name": "Outputs", 
      "text": "Outputs", 
      "checked": true, 
      "items": [ 
       { 
       "Name": "Output", 
       "text": "Investment Level by Objective", 
       "checked": true, 
       "items": [ 

       ] 
       } 
      ] 
      } 
     ] 
     }, 
     { 
     "Name": "Tab", 
     "text": "Risk", 
     "checked": true, 
     "items": [ 
      { 
      "Name": "Grid", 
      "text": "Risk Grid", 
      "checked": true, 
      "items": [ 

      ] 
      }, 
      { 
      "Name": "Outputs", 
      "text": "Outputs", 
      "checked": true, 
      "items": [ 
       { 
       "Name": "Output", 
       "text": "Portfolio Risk", 
       "checked": true, 
       "items": [ 

       ] 
       }, 
       { 
       "Name": "Output", 
       "text": "Portfolio Risk Stacked Bar", 
       "checked": true, 
       "items": [ 

       ] 
       } 
      ] 
      } 
     ] 
     } 
    ] 
    }, 
    { 
    "Name": "Section", 
    "text": "Project", 
    "checked": false, 
    "items": [ 
     { 
     "Name": "Tab", 
     "text": "Matrix", 
     "checked": true, 
     "items": [ 
      { 
      "Name": "Grid", 
      "text": "Matrix Grid", 
      "checked": true, 
      "items": [ 

      ] 
      } 
     ] 
     }, 
     { 
     "Name": "Tab", 
     "text": "Strategy", 
     "checked": true, 
     "items": [ 
      { 
      "Name": "Grid", 
      "text": "Strategy Grid", 
      "checked": true, 
      "items": [ 

      ] 
      }, 
      { 
      "Name": "Outputs", 
      "text": "Outputs", 
      "checked": true, 
      "items": [ 
       { 
       "Name": "Output", 
       "text": "Project Tactic Linkage", 
       "checked": true, 
       "items": [ 

       ] 
       }, 
       { 
       "Name": "Output", 
       "text": "OGTM", 
       "checked": true, 
       "items": [ 

       ] 
       } 
      ] 
      } 
     ] 
     }, 
     { 
     "Name": "Tab", 
     "text": "Risk", 
     "checked": false, 
     "items": [ 
      { 
      "Name": "Grid", 
      "text": "Risk Grid", 
      "checked": false, 
      "items": [ 

      ] 
      }, 
      { 
      "Name": "Outputs", 
      "text": "Outputs", 
      "checked": true, 
      "items": [ 
       { 
       "Name": "Output", 
       "text": "Risk Charts", 
       "checked": true, 
       "items": [ 

       ] 
       } 
      ] 
      } 
     ] 
     } 
    ] 
    } 
] 

私のデータソースは正しいですが。それには何が欠けていますか?私は何の誤りもありません。私のツリーはhtmlでレンダリングされていません。

答えて

1

新しいkendo.data.HierarchicalDataSourceにデータを配置してみてください。

関連する問題