【发布时间】:2014-06-29 00:09:38
【问题描述】:
嗨,我正在尝试使用 Collectionview 在 emberjs 中构建 Coverflow
我想在所有孩子都渲染后我将需要 css 计算,但我无法做到这一点,因为在我的情况下没有触发回调
整个箱子enter link description here 我的收藏视图如下所示
App.CoverflowView = Ember.CollectionView.extend({
items: null,
itemSize: null,
props: ['width', 'Width', 'left', 'Left'],
itemWidth: null,
itemHeight: null,
duration: null,
current: null,
elementId: 'coverflow',
createChildView: function (viewClass, attrs) {
viewClass = App.CoverView;
return this._super(viewClass, attrs);
},
onChildViewsChanged: function (obj, key) {
console.log('check');
var length = this.get('childViews.length');
if (length > 0) {
Ember.run.scheduleOnce('afterRender', this, 'childViewsDidRender');
}
}.observes('childViews'),
childViewsDidRender: function () {
console.log('childViewsDidRender - count of paragraphs: ');
}
});
【问题讨论】: