mardi 1 décembre 2015

ember-collection example not working

I installed the alpha 4* and tried it with the example from README.

However, I only see a container with "height: 500000px" (yes, 500k px) with some of the rendered items (5 of 10k). Scrolling only works with the scrollbar instead of of dragging. However, no new items do appear when doing so.

Console throws this error:

fixed-grid.js:74 Uncaught TypeError: height depends on the first argument of visibleWidth(number)

template.hbs:

<div class="row" style="height: 500px; background: #CCC;">
  <div class="col-md-12" style="height: 100%; position: relative;">
    {{#ember-collection items=model cell-layout=(fixed-grid-layout 800 50) as |item index|}}
      {{item.name}}
    {{/ember-collection}}
  </div>
</div>

route.js:

import Ember from 'ember';

export default Ember.Route.extend({
  model: function() {
    var items = [];
    for (var i = 0; i < 10000; i++) {
      items.push({name: "Item " + i});
    }
    return items;
  }
});

Regards, haggis

* git://github.com/emberjs/ember-collection.git#d7c453d9400dc9f8c55a6b4b31104abafb47aa61




Aucun commentaire:

Enregistrer un commentaire