我不知道如何在下面的最后两行代码中添加项目。来自 flickr 的图像正在正确加载。TR.view.photoset.Carousel.add(items) 导致错误消息
“未捕获的类型错误:对象函数 () { return this.constructor.apply(this, arguments); } 没有方法‘添加’”
Ext.define('TR.view.photoset.Carousel', {
extend: 'Ext.carousel.Carousel',
alias: 'widget.photosetcarousel',
config: {
store: 'PhotosetPhotos',
itemTpl: '<img src="http://src.sencha.io/{[Ext.Viewport.getOrientation()]}/{photo_url}" />',
title: 'Flickr Photoset',
iconCls: 'hot',
iconMask: true,
scrollable: {
direction: 'vertical',
directionLock: true
},
},
initialize: function( me ) {
var store = Ext.getStore('PhotosetPhotos');
store.clearFilter(true);
store.filter('photoset', '72157632230262446' );
store.load();
store.load( function(pictures , operation ) {
var items = [];
Ext.each(pictures, function(picture) {
if (!picture.get('photo_url')) {
return;
}
items.push({
xtype: 'flickrimage',
picture: picture
});
});
// fill items into carousel above
{???}.add(items);
{???}.setActiveItem(0);
});
}
});
感谢帮助 ...