Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>Ember List View Samples</title>
  <style>
    body {
      font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    }
    
    h2 {
      font-weight: 200;
    }
    
    .ember-list-view {
      overflow: auto;
      position: relative;
      width: 100%;
    }
    
    .ember-list-item-view {
      position: absolute;
      font-size: 17px;
      font-weight: 200;
    }
    
    .examples-list {
      list-style-type: none;
      margin: 0;
      padding: 0;
    }
    
    .examples-list li {
      float: left;
      margin: 0 50px 0 20px;
    }
  </style>
</head>
<body>
  <div id="app"></div>
  <script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
  <script src="https://raw.github.com/wycats/handlebars.js/1.0.0-rc.3/dist/handlebars.js"></script>
  <script src="http://builds.emberjs.com/ember-latest.js"></script>
  <script src="http://builds.emberjs.com/list-view/list-view-latest.js"></script>
 
  <script type="text/x-handlebars" data-template-name="item">
    {{name}}
  </script>
  
  <script type="text/x-handlebars" data-template-name="index">
    {{view App.ListView contentBinding="content"}}
  </script>
  
  <script>
      App = Ember.Application.create({});
      App.IndexController = Ember.ArrayController.extend({
        content: []
      });
      App.IndexRoute = Ember.Route.extend({
        setupController: function(controller) {
          var content = [];
          for (var i = 0; i < 10000; i++) {
            content.push({name: 'Item ' + i});
          }
          controller.set('content', content);
        }
      });
      App.ListView = Ember.ListView.extend({
        height: 500,
        width: 500,
        elementWidth: 80,
        rowHeight: 20,
        itemViewClass: Ember.ListItemView.extend({template: Handlebars.compile('{{name}}')})
      });
  </script>
</body>
</html>
Output 300px

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
alex.navasardyanpro
0viewers