Say, in your application, there is a data set that needs to be presented to users in the form of a list, where users can scroll through the list and make their selection, for example, a list of contacts, list of places, list of matching words, and so on. Sencha Touch provides a List
component to handle any list-related needs. This recipe shows how to use it to present the contact list to the user.
Make sure that you have set up your development environment by following the recipes outlined in Chapter 1.
Carry out the following steps:
Create and open a new file named
ch06_04.js
and paste the following code in it:Ext.setup({ onReady: function() { Ext.regModel('Contact', { fields: ['firstName', 'lastName'] }); var store = new Ext.data.JsonStore({ model : 'Contact', data: [ {firstName: 'Ajit', lastName: 'Kumar'}, {firstName: 'Alok', lastName: 'Ranjan'}, {firstName: 'Pradeep',lastName: 'Lavania...