Extjs scrollTo Sample

by wales

HTML

<script src="https://cdnjs.cloudflare.com/ajax/libs/extjs/3.4.1-1/adapter/ext/ext-base.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/extjs/3.4.1-1/ext-all.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/extjs/3.4.1-1/resources/css/ext-all.css">

JavaScript

Ext.onReady(function () {
    new Ext.Panel({
        title: 'Parent',
        height: 200,
        autoScroll: true,
        width: 700,
        id: 'Parent',
        renderTo: Ext.getBody(),
        items: [{
            xtype: 'panel',
            title: 'Child',
            height: 1000,
            width: 1000,
            items: [{
                xtype: 'button',
                text: 'Please Scroll me....',
                handler: function (cmp) {
                    Ext.getCmp('Parent').body.scrollTo('left', 50);

                }
            }]
        }]
    })
})