Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I use kendo ui listview with angularjs

Does anyone know where can i find an example of kendo ui listview with angularjs? I was able to find examples for grid and drop down list. But what about all other controls? no example...

like image 606
julius_am Avatar asked Jan 16 '14 12:01

julius_am


1 Answers

The following should work:

  <div ng-controller="MyController">    
    <div>Products: {{products.total()}}</div>
    <div kendo-list-view k-data-source="products" k-template="template">
    </div>
    <script id="template" type="text/x-kendo-template">
      <div>
         #= name #
      </div>
    </script>
  </div>

<script>
function MyController($scope) {
   $scope.products = new kendo.data.DataSource({ 
     data: [
        { id:1, name:'Tennis Balls', department:'Sports'},
        { id:2, name:'Basket Balls', department:'Sports'},
        { id:3, name:'Oil', department:'Auto'},
        { id:4, name:'Filters', department:'Auto'},
        { id:5, name:'Dresser', department:'Home Furnishings' }
    ]
  });
  $scope.template = $("#template").html();
}
</script>

Here is a live demo: http://jsbin.com/ODElUfO/69/edit

like image 150
Atanas Korchev Avatar answered Sep 18 '22 18:09

Atanas Korchev