Threaded View
-
19 Dec 2012 11:25 AM #1
[2.1] List's refresh() method does not re-render the itemTpl
[2.1] List's refresh() method does not re-render the itemTpl
REQUIRED INFORMATION
Touch version tested:- Sencha Touch 2.1.0
- Safari 5.1.2
- Chrome 23.0.1271.97
- When you use setItemTpl to change the template for a list, it will continue to show the old template even after calling refresh() on the list. The documentation for refresh() states that it "Refreshes the view by reloading the data from the store and re-rendering the template" but it doesn't seem to work that way. It seemed to work in Sencha Touch 2.0.1 and 1.1, but no longer works.
- create a list with an initial template
- set a new template using setItemTpl()
- call refresh() on the list
- The new template should take effect.
- The old template continued to show up for the list.
HELPFUL INFORMATIONCode:Ext.Viewport.add( { id: 'MainList', xtype: 'list', itemTpl: '{name}', store: { fields: ['name', 'position'], data: [ { name: 'Bob', position: 'Goalie' }, { name: 'Tom', position: 'Left Wing' }, { name: 'Ralph', position: 'Defense' } ] }, items: [ { docked: 'top', xtype: 'toolbar', items: [ { xtype: 'button', text: 'Update Template', ui: 'accept', handler: function () { this.up('list').setItemTpl('{position}'); this.up('list').refresh(); } } ] } ] });
Operating System:- Windows Server 2003
- Windows 7
This issue duplicates another issue.


Reply With Quote