-
8 Nov 2012 8:18 AM #11
-
8 Nov 2012 8:24 AM #12Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,599
- Vote Rating
- 434
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
8 Nov 2012 12:53 PM #13
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 ).
-
9 Nov 2012 5:48 AM #14
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) } });
-
9 Nov 2012 8:55 AM #15
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.
-
12 Nov 2012 7:59 AM #16Sencha - Sencha Touch Dev Team
- Join Date
- Mar 2007
- Location
- Haarlem, Netherlands
- Posts
- 1,235
- Vote Rating
- 4
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(); } });
-
12 Nov 2012 10:32 AM #17
Thanks Tommy, the fix works great for me.
Alex's workaround was working for me as well.
-
13 Nov 2012 9:52 AM #18
@TommyMaintz thanks nice fix until Sencha figures it out.
-
13 Nov 2012 12:08 PM #19
-
28 Nov 2012 4:31 PM #20
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.
Success! Looks like we've fixed this one. According to our records the fix was applied for
TOUCH-3677
in
Sprint 28.



Reply With Quote
