[BETA-1] SetData doesn't write data & render chosen Tpl
Hey,
I am wondering if setData has changed at all, as calling setData on a tpl-powered panel no longer renders out the data passed in.
However, I notice that calling getData() afterwards displays the same passed-in data no problem, in the same format. The parent object contains nothing within items when I called a console.log().
Below is a chunk of the code that's dealing with these elements.
View:
Code:
var myTpl = new Ext.XTemplate(
'<div id="scroller" style="width:100%;">' +
'<tpl for=".">' +
'<div class="list-item bethistory-item" id="h{index}">' +
'<p class="name">{name} {handicap}</p>' +
'<tpl if="legs.length > 1">' +
'<p class="more">plus {legs.length-1} more selection</p>' +
'</tpl>' +
'<tpl if="status == \'active\'">' +
'<p>Output {output}</p>' +
'</tpl>' +
'<tpl if="status == \'pending\'">' +
'<p>Potential Output {output}</p>' +
'</tpl>' +
'</div>' +
'</tpl>' +
'</div>'
);
[...]
{
xtype: 'panel',
id: 'historylist',
scrollable: 'vertical',
layout: 'vbox',
items: [
{
xtype: 'panel',
tpl: myTpl,
id: 'historylistcontent',
layout: 'fit',
scrollable: false,
},
{
xtype: 'panel',
cls: 'loadmore-wrap',
id: 'loadmorebutton',
html: '<span class="black_square_button more_button" id="load-more">Load More</span>'
}
]
},
Controller:
Code:
// Within the references of the Controller's config:
historyListContent: {
selector: '#historylistcontent',
},
[...]
listContent = this.getHistoryListContent(),
[...]
console.log(data); // This outputs the data as an array of objects.
listContent.setData(data); // Call setData and push data into panel.
console.log(listContent.getData()); // The same array objects as above
console.log(listContent); // Nothing within 'items', listContent is still empty?
[...]