We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Essential JS2

Syncfusion jQuery based widgets are no longer in active development. Switch to our pure JavaScript based next generation Essential JS 2 library.

Syncfusion Feedback

How to render TreeGrid using AngularJS

Platform: jQuery |
Control: ejTreeGrid

The below code snippet explains rendering TreeGrid using AngularJS. You can also find the complete user guide documentation for TreeGrid here.

Code snippets:


<html lang="en" ng-app="listCtrl">
    <meta charset="utf-8" />
    <!-- style sheet for default theme(flat azure) -->
    <link href="http://cdn.syncfusion.com/" rel="stylesheet">
    <!--script reference-->
    <script src="http://cdn.syncfusion.com/js/assets/external/jquery-1.10.2.min.js"></script>
    <script src="http://cdn.syncfusion.com/js/assets/external/jsrender.min.js"></script>
    <script src="http://cdn.syncfusion.com/js/assets/external/jquery.globalize.min.js"></script>
    <script src="http://cdn.syncfusion.com/js/assets/external/jquery.easing.1.3.min.js"></script>
    <script src="http://cdn.syncfusion.com/" type="text/javascript"></script>
<body ng-controller="TreeGridCtrl">
    <div ej-treegrid e-datasource="data" e-selectedrowindex="selectedRow" e-treecolumnindex="1" e-columns="columns" e-childmapping="subtasks" e-enablevirtualization="true" id="treegrid">
<script type="text/javascript">
 var projectData = [
         taskID: 1,
         taskName: "Planning",
         startDate: "02/03/2014",
         endDate: "02/07/2014",
         progress: 100,
         subtasks: [
             { taskID: 2, taskName: "Plan timeline", startDate: "02/03/2014", endDate: "02/07/2014", duration: 5, progress: 100 },           
  var columns = [
                { field: "taskID", headerText: "Task Id", width: "60"},
                { field: "taskName", headerText: "Task Name"},
                { field: "startDate", headerText: "Start Date"},
                { field: "endDate", headerText: "End Date"},                
                { field: "progress", headerText: "Progress"}
        angular.module('listCtrl', ['ejangular'])
        .controller('TreeGridCtrl', function ($scope) {
            $scope.selectedRow = 1;
            $scope.data = projectData;
            $scope.columns = columns;

Sample link

A sample to render TreeGrid with AngularJS is available in the following link, Sample

You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile