JavaScript
Run Code
Open in Fiddle
Ext.application({ name : 'Fiddle', launch : function() { Ext.Viewport.add({ xclass: 'Ext.dataview.List', itemTpl: '<div>{i}</div>', store: { data: ((i, length) => { const data = []; while (i < length) { data.push({ i }); i++ } return data; })(0, 1000) }, items: [ { xclass: 'Ext.Toolbar', docked: 'top', items: [ { xclass: 'Ext.Button', text: 'Scroll To First', handler (btn) { const list = btn.up('list'); const checkbox = list.down('checkbox'); const record = list.getStore().first(); list.scrollToRecord(record, checkbox.getChecked()); } }, { xclass: 'Ext.Button', text: 'Scroll To Last', handler (btn) { const list = btn.up('list'); const checkbox = list.down('checkbox'); const record = list.getStore().last(); list.scrollToRecord(record, checkbox.getChecked()); } }, { xclass: 'Ext.field.Checkbox', checked: true, boxLabel: 'Animation?' } ] } ] }); } });