0

I am implementing kendo treeview of checkboxes in angular. I get no error, but tree is not rendering. My code is here:

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']);

I get datasource from webservice. here is 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": [

                ]
              }
            ]
          }
        ]
      }
    ]
  }
]

Although my data source is correct. What thing is missing in it? I am not getting any error. My tree is not rendering in html.

1 Answer 1

1

Try placing your data in a new kendo.data.HierarchicalDataSource

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.