リストの詳細ビューにカルーセル パネルが必要です。フレックス3のカルーセルをパネル内に配置しました。このコードを使用して、パネル項目内の tpl が機能することを確認します。しかし、カルーセルの問題を解決する方法がわかりません。
パネル項目内の tpl のコード:
updateData: function(newData, oldData) {
this.down('component').setData(newData);
this.getAt(0).setData(newData); this.getAt(1).setData(newData);
}
私の WorkDetail.js の完全なコード
Ext.define('Portfolio.view.WorkDetail', {
extend: 'Ext.Panel',
xtype: 'workdetail',
requires: [
'Ext.carousel.Carousel'
],
config: {
xtype: 'panel',
layout: 'hbox',
align: 'stretch',
styleHtmlContent: true,
scrollable: null,
items: [
{
flex:3,
xtype: 'carousel',
// HERE THE TLP WORKS
// tpl: '<img src="{bigImage1}"></img>',
// style: 'background-color: #456370;',
items: [
{
// TPL DON'T WORK
tpl: '<img src="{bigImage1}"></img>',
style: 'background-color: #E84F17;'
},
{
// TPL DON'T WORK
tpl: '<img src="{bigImage2}"></img>',
style: 'background-color: #4DBAB6;'
},
{
// TPL DON'T WORK
tpl: '<img src="{bigImage3}"></img>',
style: 'background-color: #BBB399;',
}
]
},
{
// HERE THE TLP WORKS
flex:1,
tpl: '<p>{workDiscriptionLarge}</p> <p>{workDate}</P> <a href="{hyperLink}">Bekijk de website</a>'
}
]
},
updateData: function(newData, oldData) {
this.down('component').setData(newData);
this.getAt(0).setData(newData);
this.getAt(1).setData(newData);
}
});