默认情况下如何选择列表中的第一项,而不点击它?以下是我的观点。
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'}
]
}
});
答案 0 :(得分:1)
Ext.List有两种方法可以帮助你:
list.select( record, keepExisting, surpessEvent );
list.selectRange( startRecordIndex, endRecordIndex, keepExisting );
在您的情况下,您可以使用list.selectRange( 1, 1, false );
选择第二条数据记录。