jep
17 Jun 2011, 10:32 AM
I've tested this both on 1.1.0 and on trunk as of today (2011-06-17). Both show a problem with this example:
<html>
<head>
<title>test</title>
<link rel="stylesheet" href="../sencha-touch-trunk/20110617/resources/css/sencha-touch.css" type="text/css">
<script type="text/javascript" src="../sencha-touch-trunk/20110617/sencha-touch-debug.js"></script>
<!-- <link rel="stylesheet" href="../sencha-touch-1.0.0/resources/css/sencha-touch.css" type="text/css">-->
<!-- <script type="text/javascript" src="../sencha-touch-1.0.0/sencha-touch-debug.js"></script> -->
<script type="text/javascript">
Ext.setup({
onReady: function() {
Ext.regModel('Contact', {
fields: ['firstName', 'lastName']
});
var list = new Ext.List({
itemTpl:'<div class="contact">{#} {name}</div>',
store: new Ext.data.Store({
model: 'Contact',
data: [
{name:'George'},
{name:'John'},
{name:'Thomas'},
]
})
});
var mainPnl = new Ext.Panel({
layout:'fit',
fullscreen: true,
items:list,
dockedItems:{
xtype:'toolbar',
dock:'top',
items:{xtype:'button', text:'Refresh', handler:function () { list.refreshNode(1) } }
}
});
}
});
</script>
</head>
<body></body>
</html>
When you click on the Refresh button, it calls refreshNode(1). You'll see that this causes that item to get its # template parameter value set to 1 instead of the correct value. Calling list.refresh() will cause it to be re-rendered with the correct value.
<html>
<head>
<title>test</title>
<link rel="stylesheet" href="../sencha-touch-trunk/20110617/resources/css/sencha-touch.css" type="text/css">
<script type="text/javascript" src="../sencha-touch-trunk/20110617/sencha-touch-debug.js"></script>
<!-- <link rel="stylesheet" href="../sencha-touch-1.0.0/resources/css/sencha-touch.css" type="text/css">-->
<!-- <script type="text/javascript" src="../sencha-touch-1.0.0/sencha-touch-debug.js"></script> -->
<script type="text/javascript">
Ext.setup({
onReady: function() {
Ext.regModel('Contact', {
fields: ['firstName', 'lastName']
});
var list = new Ext.List({
itemTpl:'<div class="contact">{#} {name}</div>',
store: new Ext.data.Store({
model: 'Contact',
data: [
{name:'George'},
{name:'John'},
{name:'Thomas'},
]
})
});
var mainPnl = new Ext.Panel({
layout:'fit',
fullscreen: true,
items:list,
dockedItems:{
xtype:'toolbar',
dock:'top',
items:{xtype:'button', text:'Refresh', handler:function () { list.refreshNode(1) } }
}
});
}
});
</script>
</head>
<body></body>
</html>
When you click on the Refresh button, it calls refreshNode(1). You'll see that this causes that item to get its # template parameter value set to 1 instead of the correct value. Calling list.refresh() will cause it to be re-rendered with the correct value.