0

デフォルトでは、タップせずにリストの最初の項目を選択する方法は? 以下は私の見解です。

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'}
        ]
    }
});
4

1 に答える 1

1

Ext.List には、役立つ 2 つのメソッドがあります。

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

あなたの場合list.selectRange( 1, 1, false );、2番目のデータレコードを選択するために使用できます。

于 2014-07-20T12:22:49.133 に答える