title: Kendo treeList datasource - not getting bound with remote data
body: <p>I have written a directive for treeList and binding data to it from remote service call. Below is the code for TreeListDataSource in link method of directive:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>scope.treeListOptions.dataSource = new kendo.data.TreeListDataSource({
    transport: {
      read: function(options) {
        scope.getData().then(function(dataToBeDisplayed) {
          options.success(dataToBeDisplayed);
        }, function(error) {
          $log.error(error);
        });
      },
      error: function(e) {
        alert(e.status + e.errorThrown);
      },
    },
  });
  
  scope.treeListOptions.dataSource.read(); </code></pre>
  </div>
  </div>
  </p>
  
  <p>following is the TreeList directive definition:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var TreeListDirectiveDefinition = {
    restrict: 'E',
    replace: true,
    template: '&lt;div&gt;&lt;kendo-treelist k-options="treeListOptions"&gt;&lt;/kendo-treelist&gt;&lt;/div&gt;',
    scope: {
      columns: '=',
      getMethod: '&amp;'
    },
    link: linkTreeList
  };</code></pre>
  </div>
  </div>
  </p>
  
  <p>When i see the data bound to scope.treeListOptions.dataSource.data(), there are many new properties added as shown below:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>// parent element
  C.define.init
  PartExamined: "test"
  StudyUid: "1.3.6.1.4.1.30071.8.56809868014.4964677242993979.234.56616"
  _events: Object
  _loaded: true
  dirty: false
  hasChildren: true
  id: 1
  parent: ()
  parentId: null
  parentIdField: "parentId"
  uid: "1ca6302c-b1ad-493f-b002-d2032a548a80"
  __proto__: i.extend.i
  
  
  //child element
  C.define.init
  PartExamined: "test2"
  SeriesInstanceUid: "1.3.6.1.4.1.30071.8.56809868014.4964677242993979.234.56617"
  _events: Object
  _loaded: true
  dirty: false
  hasChildren: false
  id: 2
  parent: ()
  parentId: 1
  parentIdField: "parentId"
  uid: "953bc7a7-e5e8-4f26-a120-b13402c6cce4"
  __proto__: i.extend.i</code></pre>
  </div>
  </div>
  </p>
  
  <p>Properties like <strong>parent: (), parentIdField: "parentId", _loaded: true, dirty: false, hasChildren: true</strong> are added by the TreeListDataSource. </p>
  
  <p>Is this the correct format for data? because the the TreeList is displaying <strong>"No records to display"</strong>. </p>
  
  <p>Can anyone help me fix this issue?</p>
  
  <p><strong>UPDATED</strong>
  Here is the link for angular directive created for treeList: <a href="http://jsfiddle.net/yuqorcvL/15/" rel="nofollow">http://jsfiddle.net/yuqorcvL/15/</a></p>
  
  <p>The directive is still not work. Any help will be appreciated.</p>
  
  <p>Thanks.</p>