Results 1 to 2 of 2

Thread: Scroll to position inside tabPanel

  1. #1
    Sencha User
    Join Date
    Jun 2012
    Posts
    35

    Default Scroll to position inside tabPanel

    I have a window, containing a tabPanel, this tabPanel has 4 tabs. I wanted to write down something like user manual so I created several panels inside the tabs, each panel contains some text and pics.
    from another button, I want to scroll to a particular postiton in that tab. How can I do it? here is my structure, and let's say I want the button to open the first tab, scrolling to the third panel (id:here).


    tabPanel:

    Code:
    var   tabs = Ext.createWidget('tabpanel', {
           id: 'myTabs',
            header: false,
            activeTab: 3,
        closable: true,
        defaults:{ autoScroll:true },       
            items: [
    
    
            {
                title: 'first',
                itemId: 'firstTab',         
                items: [
                {
                    xtype: 'panel',
                    html: text39,
                    cls: 'layout_text1'
                },
               {        
                xtype: 'panel',
                   html: text40,
                cls:'layout_subtitle'
                },{
                    xtype: 'panel',
                    id: 'here',
                    html: text41,
                    cls: 'layout_text2'
                }]  
    });
    window:

    Code:
    var UMwindow = new Ext.Window({
                id: 'myWindow',
            name: 'userManual',
                closable: true,
                floating: true,
                width: 900,
                height: 600,
            items  : myTabs,
    
    
    
    
    }).show();

    I managed to open the window then activating the first tab using:
    Code:
    Ext.getCmp('myTabs').setActiveTab('firstTab');
    but then I couldn't figure out how to scroll down to the position i need "third panel in my example". do I have to add property to the panel such as position or something?


  2. #2
    Sencha Premium User
    Join Date
    Feb 2011
    Location
    NJ
    Posts
    337

    Default

    You can use the scrollIntoView method: http://docs.sencha.com/extjs/4.2.2/#...scrollIntoView

    Here's an example:


Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •