PDA

View Full Version : Dataview with XTemplate using Array Index and Store record update



fdp
14 Jun 2012, 6:05 AM
Hi,

I have a simple dataview, with a simple store with lets say 9 items.



Ext.create('widget.dataview', {
store: mystore,
itemSelector: 'mywrap',
tpl: [
'<tpl for=".">',
'<div class="mywrap">N.{#} #{id_question}</div>',
'</tpl>'
]
});


On first display the array index counter works well and it prints numbers from 1 to 9.

The problem is that if my store is updated the view is updated too but the {#} evaluates to 1 and not the initial value.

For example if I update record 3, my dataview display 1 2 1 4 5 6 7 8 9

Is there any other tips to use an array index that is valid even with update?

Thanks.