Angularjs + kendo-ui treeview.

3 posts, 0 answers
  1. Jose Mejia
    Jose  Mejia avatar
    107 posts
    Member since:
    May 2009

    Posted 26 Aug 2013 Link to this post

    Hi.
    I'm trying to use  angular-kendo framework and it seems pretty cool!
    But I can't to make working treeview...
    I use following angular controller:
    function HomeCtrl($scope)
    {
     $scope.things = {dataSource: [{ name: "Thing 1", id: 1 },{ name: "Thing 2", id: 2 },{ name: "Thing 3", id: 3 }]}
    }
    and following template:

    <div  kendo-treeview   <br>        
    k-data-source="things"        
    k-data-text-field="'name'" />
    But it doesn't work...  While other controls taken from sample angular-kendo framework like grid
    work great.

    This chunk of code also works:
    <div id="treeview"></div>
    <script>
    $("#treeview").kendoTreeView({
      dataTextField: [ "name"],
      dataSource: [{ name: "Thing 1", id: 1 },{ name: "Thing 2", id: 2 },{ name: "Thing 3", id: 3 }]
    });
    </script>


    What I'm doing wrong?

    Thanks in advance.
  2. Burke
    Admin
    Burke avatar
    11 posts

    Posted 28 Aug 2013 Link to this post

    Hello,

    It's actually because it's kendo-tree-view.  That's confusing - I know.  I am thinking about adding a different entry point to the directives that closely mimics the jQuery one.

    But more than that, there appears to be an issue with the TreeView directive.  Would you please open an issue on this over on the GitHub repo?  That is where we are tracking and closing issues.

    Here is a Plunker to get you started.  You can provide this when you open the issue.

    http://plnkr.co/edit/tpl:wj0Q4i1RKJu9G2UquC7d?p=preview 

    Regards,
    Burke
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. Jose Mejia
    Jose  Mejia avatar
    107 posts
    Member since:
    May 2009

    Posted 29 Aug 2013 Link to this post

    Thank you for reply, Burke!

    There is already exists github issue -- https://github.com/kendo-labs/angular-kendo/issues/79.

    For now I have ugly workaround:
    <div id="treeview"></div>
    <script>
     
        var ds = angular.element('[ng-controller=HomeCtrl]').scope().things;
        console.log(ds)
        $("#treeview").kendoTreeView({
            dataTextField: ["name"],
            dataSource: ds
        });
    </script>
Back to Top