Results 1 to 4 of 4

Thread: Timed Tabs

  1. #1

    Default Timed Tabs

    I was wondering if extjs has the ability to advance between tabs with a given time variable, any help on this would be great!

  2. #2
    Sencha Premium User evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    19,256

    Default

    DelayedTask and activate should do it for you.

  3. #3

    Default

    Code:
    <?php 
    
    $random_tab = rand(0,12);
    
    ?>
    
    <script type="text/javascript">
    Ext.onReady(function(){
        // basic tabs 1, built from existing content
        var tabs = new Ext.TabPanel({
            renderTo: 'tabs1',
            width:890,
    		height:250,
            activeTab: <?php echo $random_tab; ?>,
            frame:false,
            defaults:{autoHeight: false},
            items:[
    		
                {contentEl:'news_tab', title: 'News'},
                {contentEl:'photos_tab', title: 'Photos'},
    			 {contentEl:'dining_tab', title: 'Dining'},
                {contentEl:'nightlife_tab', title: 'Night Life'},
    			 {contentEl:'music_tab', title: 'Music'},
                {contentEl:'movies_tab', title: 'Movies'},
    			 {contentEl:'culture_tab', title: 'Culture'},
                {contentEl:'resortsandcasinos_tab', title: 'Resorts & Casinos'},
    			 {contentEl:'lodging_tab', title: 'Lodging'},
                {contentEl:'recreation_tab', title: 'Recreation'},
    			 {contentEl:'sports_tab', title: 'Sports'},
                {contentEl:'community_tab', title: 'Community'},
    			 {contentEl:'blogs_tab', title: 'Blogs'}
            ]
        });
    
       
    });
    So with the above code, how would I go about doing this to activate a new tab, does it need a new variable? I apologize, I am pretty new to javascript.

  4. #4
    Sencha Premium User evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    19,256

    Default

    Give your TabPanel an id. You can then retrieve it using:

    Code:
    var tabs = Ext.getCmp('myTabs');

Posting Permissions

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