Available to support subscribers only?
Printable View
The records on screen are being rendered improperly and the ones off the screen are being rendered correctly ( try resizing your browser window and you'll see some that are working ).
It seems that list item's tpl property set only when sencha creates this item. And it didn't updated when we call refresh method.
I can suggest two solutions:
1 - Use dataview instead a list (it can be styled to look like a list)
2 - Use this fix:
Code:Ext.override(Ext.dataview.List, {
updateListItem: function(item, index, info) {
var record = info.store.getAt(index);
if (this.isSelected(record)) {
item.addCls(info.selectedCls);
}
else {
item.removeCls(info.selectedCls);
}
item.setTpl(this.getItemTpl());
item.removeCls([info.headerCls, info.footerCls, info.firstCls, info.lastCls]);
this.replaceItemContent(item, index, info)
}
});
Thanks for the fix! I hadn't looked at that #setTpl method.
I actually ended up creating new lists for each time I would normally just call #setItemTpl. Horrible, I know, but something had to happen yesterday.
Try the following override:
Code:Ext.define('ListItemTplFix', {
override: 'Ext.dataview.List',
updateItemTpl: function(newTpl, oldTpl) {
var listItems = this.listItems,
ln = listItems.length || 0,
i, listItem;
for (i = 0; i < ln; i++) {
listItem = listItems[i];
listItem.setTpl(newTpl);
}
this.doRefresh();
}
});
Thanks Tommy, the fix works great for me.
Alex's workaround was working for me as well.
@TommyMaintz thanks nice fix until Sencha figures it out.
Thanks a lot for that.
Thanks so much for the fixes above and the bug report!
While migrating an application from Sencha Touch 1.1, I was getting nowhere searching about this problem until I realized it worked in 2.0 but not 2.1.