0

by default how to select first item in list, without tapping it? below is the my view.

Ext.define('MyApp.view.TestList', {
    extend: 'Ext.List',
    xtype: 'testlist',
    config: {
        flex: 1,
        enableSelection: true,
        itemTpl: '{item}',
        data: [
            {item: 'item-1'},
            {item: 'item-2'},
            {item: 'item-3'},
            {item: 'item-4'}
        ]
    }
});
ImDrPatil
  • 197
  • 1
  • 5
  • 11

1 Answers1

1

Ext.List has two methods that will help you:

list.select( record, keepExisting, surpessEvent );
list.selectRange( startRecordIndex, endRecordIndex, keepExisting );

In your case you can you use list.selectRange( 1, 1, false ); to select the second data record.

Martin
  • 852
  • 7
  • 20