Pre selected list items in Sencha Touch

The following code shows how-to pre select your list items in Sencha Touch:

var itemsToSelect = ["soccer", "baseball"];
var index = -1;
var myList = getMyList();

itemsToSelect.forEach(function(itemToSelect) {

   index = myList.getStore().find('fieldName', itemToSelect);
   myList.select(index,true,false); 
});

0 Kommentare:

Post a Comment