Created
August 31, 2012 22:50
-
-
Save pdehaan/3560452 to your computer and use it in GitHub Desktop.
DataView scroll to top #senchatouch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"/> | |
<title></title> | |
<link href="http://cdn.sencha.io/try/touch/2.0.1/resources/css/sencha-touch.css" rel="stylesheet" type="text/css" /> | |
<script src="http://cdn.sencha.io/try/touch/2.0.1/sencha-touch-all-debug.js"></script> | |
<script> | |
Ext.application({ | |
launch: function () { | |
Ext.create('Ext.Container', { | |
fullscreen: true, | |
items: [ | |
{ | |
docked: 'top', | |
xtype: 'titlebar', | |
items: [ | |
{ | |
text: "Scroll to top", | |
handler: function () { | |
Ext.getCmp("dv").getScrollable().getScroller().scrollTo(0, 0, false); | |
} | |
} | |
] | |
}, | |
{ | |
xtype: 'dataview', | |
id: 'dv', | |
width: 400, | |
height: 300, | |
itemTpl: '<div>{name} is {age} years old</div>', | |
store: { | |
fields: [ | |
'name', | |
'age' | |
], | |
data: [ | |
{name: 'Jamie', age: 100}, | |
{name: 'Rob', age: 21}, | |
{name: 'Tommy', age: 24}, | |
{name: 'Jacky', age: 24}, | |
{name: 'Ed', age: 26}, | |
{name: 'Jamie', age: 100}, | |
{name: 'Rob', age: 21}, | |
{name: 'Tommy', age: 24}, | |
{name: 'Jacky', age: 24}, | |
{name: 'Ed', age: 26}, | |
{name: 'Jamie', age: 100}, | |
{name: 'Rob', age: 21}, | |
{name: 'Tommy', age: 24}, | |
{name: 'Jacky', age: 24}, | |
{name: 'Ed', age: 26}, | |
{name: 'Jamie', age: 100}, | |
{name: 'Rob', age: 21}, | |
{name: 'Tommy', age: 24}, | |
{name: 'Jacky', age: 24}, | |
{name: 'Ed', age: 26}, | |
{name: 'Jamie', age: 100}, | |
{name: 'Rob', age: 21}, | |
{name: 'Tommy', age: 24}, | |
{name: 'Jacky', age: 24}, | |
{name: 'Ed', age: 26} | |
] | |
} | |
} | |
] | |
}); | |
} | |
}); | |
</script> | |
</head> | |
<body> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment