Current location: Hot Scripts Forums » General Web Coding » JavaScript » ExtJS Tab Panel Issue


ExtJS Tab Panel Issue

Reply
  #1 (permalink)  
Old 11-30-09, 12:53 PM
connor connor is offline
Wannabe Coder
 
Join Date: Apr 2005
Location: Knob Noster, Mo
Posts: 228
Thanks: 1
Thanked 0 Times in 0 Posts
Hazard ExtJS Tab Panel Issue

I am having issues getting a tabpanel form in a window not in the whole container.
$appName is set further up in the document. It is showing up just not in the window. Any help would be greatly appreciated.

PHP Code:

    var twitterUpdater = new Ext.Viewport({

        layout: 'border',
        items: [{
            region: 'north',
            collapsible: false,
            height: 27,
            margins: '0 0 5 0',
            xtype: 'panel',
            html: '<center>Coming Soon</center>'
        },{
            region: 'center',
            xtype: 'tabpanel',
            activeTab: 0,
            items:[{
                title: 'Tweets',
                xtype: 'panel',
                html: 'Here will show tweets'
            },{
                title: 'Mentions',
                xtype: 'panel',
                html: 'Here will be mentions'
            },{
                title: 'Following',
                xtype: 'panel',
                html: 'Here will be all the people we are following'
            },{
                title: 'Followers',
                xtype: 'panel',
                html: 'Here will be all the followers.'
            },{
                title: 'Settings',
                xtype: 'panel',
                html: 'Settings will go here for the admins'
            }]
        }]
    });
    var <?=$appName?> = new new Ext.Window({
        id:'<?=$appName?>',
        title:'Twitter Updater', 
        height:125,
        width:300,
        closable: true,
        draggable: true,
        resizable: true,
        minimizable: true,
        maximizable: true,
        items: [twitterUpdater]
    });
__________________
Connor Strandt
JCS Photography
www.JCStrandt.com
Reply With Quote
  #2 (permalink)  
Old 11-30-09, 01:10 PM
connor connor is offline
Wannabe Coder
 
Join Date: Apr 2005
Location: Knob Noster, Mo
Posts: 228
Thanks: 1
Thanked 0 Times in 0 Posts
This is what firebug is giving me, Im not sure what to make of it.
Quote:
new (Ext.Window)({id: "twitterWin", title: "Twitter Updater", height: 125, width: 300, closable: true, draggable: true, resizable: true, minimizable: true, maximizable: true, items: [twitterUpdater]}) is not a constructor
__________________
Connor Strandt
JCS Photography
www.JCStrandt.com
Reply With Quote
  #3 (permalink)  
Old 11-30-09, 04:11 PM
wirehopper's Avatar
wirehopper wirehopper is offline
-
 
Join Date: Feb 2006
Posts: 2,515
Thanks: 20
Thanked 109 Times in 106 Posts
It might be an issue where your server doesn't have short tags (<?= ?>) enabled.

You could try using <?php echo $variable; ?> to see if that's the issue (change $variable).
Reply With Quote
  #4 (permalink)  
Old 11-30-09, 09:49 PM
connor connor is offline
Wannabe Coder
 
Join Date: Apr 2005
Location: Knob Noster, Mo
Posts: 228
Thanks: 1
Thanked 0 Times in 0 Posts
Even taking the var out and putting in "twitterWin" didn't fix it.
__________________
Connor Strandt
JCS Photography
www.JCStrandt.com
Reply With Quote
  #5 (permalink)  
Old 12-01-09, 06:03 AM
wirehopper's Avatar
wirehopper wirehopper is offline
-
 
Join Date: Feb 2006
Posts: 2,515
Thanks: 20
Thanked 109 Times in 106 Posts
Can you post more of the code?

Specifically, the <script> tags that are pulling in ExtJS and all PHP assignments.
Reply With Quote
  #6 (permalink)  
Old 12-01-09, 10:50 AM
carters-site's Avatar
carters-site carters-site is offline
Wannabe Coder
 
Join Date: Sep 2009
Location: Moline, IL
Posts: 100
Thanks: 2
Thanked 1 Time in 1 Post
Quote:
Originally Posted by connor View Post
Even taking the var out and putting in "twitterWin" didn't fix it.
Ahh ExtJS a library I am very familiar with below is the error free version:

You had an extra new before your Ext.Window Constructor call.
Test in FireFox 3 and works.
Code:
    var twitterUpdater = new Ext.Viewport({
        layout: 'border',
        items: [{
            region: 'north',
            collapsible: false,
            height: 27,
            margins: '0 0 5 0',
            xtype: 'panel',
            html: '<center>Coming Soon</center>'
        },{
            region: 'center',
            xtype: 'tabpanel',
            activeTab: 0,
            items:[{
                title: 'Tweets',
                xtype: 'panel',
                html: 'Here will show tweets'
            },{
                title: 'Mentions',
                xtype: 'panel',
                html: 'Here will be mentions'
            },{
                title: 'Following',
                xtype: 'panel',
                html: 'Here will be all the people we are following'
            },{
                title: 'Followers',
                xtype: 'panel',
                html: 'Here will be all the followers.'
            },{
                title: 'Settings',
                xtype: 'panel',
                html: 'Settings will go here for the admins'
            }]
        }]
    });
    var twitterWin = new Ext.Window({
        id: 'twitterWin',
        title:'Twitter Updater', 
        height:125,
        width:300,
        closable: true,
        draggable: true,
        resizable: true,
        minimizable: true,
        maximizable: true,
        items: [twitterUpdater]
    }); 
    
    twitterWin.open();
Reply With Quote
  #7 (permalink)  
Old 12-09-09, 08:59 AM
connor connor is offline
Wannabe Coder
 
Join Date: Apr 2005
Location: Knob Noster, Mo
Posts: 228
Thanks: 1
Thanked 0 Times in 0 Posts
Im just trying to use a menu bar that has a drop down and when I click on an option I want it to open said window... and as it is now its just got the tab panel open... i think my issue is putting the tab panel in the window.

PHP Code:

    var twitterUpdater = new Ext.Viewport({
        
layout'border',
        
items: [{
            
region'north',
            
collapsiblefalse,
            
height27,
            
margins'0 0 5 0',
            
xtype'panel',
            
html'<center>Coming Soon</center>'
        
},{
            
region'center',
            
xtype'tabpanel',
            
activeTab0,
            
items:[{
                
title'Tweets',
                
xtype'panel',
                
html'Here will show tweets'
            
},{
                
title'Mentions',
                
xtype'panel',
                
html'Here will be mentions'
            
},{
                
title'Following',
                
xtype'panel',
                
html'Here will be all the people we are following'
            
},{
                
title'Followers',
                
xtype'panel',
                
html'Here will be all the followers.'
            
},{
                
title'Settings',
                
xtype'panel',
                
html'Settings will go here for the admins'
            
}]
        }]
    });
    
Ext.onReady(function(){
        var 
APP_twitterWin = new Ext.Window({
            
id:'twitterWin',
            
title:'Twitter Updater'
            
height:125,
            
width:300,
            
closabletrue,
            
draggabletrue,
            
resizabletrue,
            
minimizabletrue,
            
maximizabletrue,
            
items: [twitterUpdater]
        }); 
    }); 
that is my code as it sits now.
__________________
Connor Strandt
JCS Photography
www.JCStrandt.com
Reply With Quote
  #8 (permalink)  
Old 12-09-09, 09:03 AM
connor connor is offline
Wannabe Coder
 
Join Date: Apr 2005
Location: Knob Noster, Mo
Posts: 228
Thanks: 1
Thanked 0 Times in 0 Posts
And here is the menu bar.
PHP Code:

        var menuBar = new Ext.Toolbar({
        
renderTodocument.body,
        
height100,
        
items: [{
                
xtype'splitbutton',
                
text'Administration',
                
menu: new Ext.menu.Menu({
                    
items: [{
                        
text'System Management',
                        
handler: function(){
                            
sysManagementWin.open();
                        }
                    },{
                        
text'Appliacation Management',
                        
handler: function(){
                            
appManagementWin.open();
                        }
                    },{
                        
text'User Management',
                        
handler: function(){
                            
usrManagementWin.open();
                        }
                    }]
                })
            },{
                
xtype'splitbutton',
                
text'Site Managemet',
                
menu: new Ext.menu.Menu({
                    
items: [{
                        
text'Soldiers Network'
                    
},{
                        
text'Make dynamic to list all'
                    
}]
                })
            },{
                
xtype'splitbutton',
                
text'Other',
                
menu: new Ext.menu.Menu({
                    
items: [{
                        
text'Twitter Updater',
                        
handler: function(){
                            
this.APP_twitterWin.open();
                        }
                    },{
                        
text'Make dynamic to list all'
                    
}]
                })
            },
'->',{
                
xtype'splitbutton',
                
text'User Options',
                
menu: new Ext.menu.Menu({
                    
items: [{
                        
text'Your Information',
                        
handler: function(){
                            
usrInformationWin.open();
                        }
                    },{
                        
text'Change your password',
                        
handler: function(){
                            
chaPasswordWin.open();
                        }
                    },{
                        
text'E-Mail (new # here)',
                        
handler: function(){
                            
chkEmailWin.open();
                        }
                    },{
                        
text'Logout',
                        
handler: function(){
                            
Ext.Msg.confirm('Confirm?''Are you sure you want to logout?', function(btntext){
                                if (
btn == 'yes'){
                                    
window.location="../includes/backend.php?op=logout";
                                }
                            })
                        }
                    }]
                })
            }]
        }); 
__________________
Connor Strandt
JCS Photography
www.JCStrandt.com
Reply With Quote
  #9 (permalink)  
Old 12-18-09, 09:02 AM
carters-site's Avatar
carters-site carters-site is offline
Wannabe Coder
 
Join Date: Sep 2009
Location: Moline, IL
Posts: 100
Thanks: 2
Thanked 1 Time in 1 Post
You are assigning a Ext.Viewport to the window. This is not what you want to use. The viewport is essentially the browser's viewable area, basically anything you declare to Viewport is rendered to the document body. It is not actually an object you can assign like other Ext objects. Anything you put in the items list for the viewport will be rendered to document.body on load.

What you are wanting to do actually involves a Ext.Panel. You should change the area where you have viewport to Ext.Panel.


Now as far as the Toolbar you should not use renderTo, I have found it somewhat sloppy of a method to do things in ExtJS. Instead you should do something like this.

javascript Code:
  1. /* your code for menuBar */
  2.  
  3. oView = Ext.Viewport({
  4.      layout: 'fit',
  5.      items: [{
  6.          xtype: 'panel',
  7.          tbar: menuBar,
  8.          border: false,
  9.          layout: 'fit'
  10.      }]
  11. });

This will add a container panel inside of your viewport that supports a toolbar. Hope that helps you out.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Tab Styled Accordion Issue HeX Productions JavaScript 0 04-30-09 02:08 PM
[SOLVED] Collapsible Panel Issue digioz JavaScript 1 11-15-08 11:41 AM
BOTTOM sliding panel. TheMexican Flash & ActionScript 2 05-20-08 12:25 PM


All times are GMT -5. The time now is 01:59 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.