PDA

View Full Version : Show Current Record in XTemplate for List



zillabyte
16 Dec 2011, 8:09 AM
I'm new to Sencha Touch so bear with me. I'm using the Orielly example to build a basic website. One thing I'd like to do is to show a number value next to a list of items. So, item number one would have a 1. next to it, item two would have a 2. next to it. I can do this through the database and populate it as a field when I return the records. I'd like to know if this is possible in the XTemplate rather than creating this field in my Model. Can this be done?

mitchellsimoens
16 Dec 2011, 9:38 AM
Use this in your XTemplate:


{[xindex + 1]}

zillabyte
16 Dec 2011, 10:07 AM
Thanks, this is exactly what I was looking. Doesn't appear the +1 is needed though.