1. #1
    Sencha User
    Join Date
    Jun 2009
    Location
    Burlington, Ontario
    Posts
    174
    Answers
    3
    Vote Rating
    2
    Bleak is on a distinguished road

      0  

    Default Answered: Adding to a Viewport

    Answered: Adding to a Viewport


    I have a standard viewport, which is basically empty. If I run this code, it properly adds the ui component and renders;


    PHP Code:
     var Dashboard Ext.create('Ext.Panel', {
                
    xtype       'project-dashboard',
                
    alias       'dashboard.widget',
                
    fullscreen  true,
               
    items: [
                    { 
                       
    dock 'top'
                       
    xtype'toolbar'
                       
    title'Standard Titlebar' 
                   
    }, 
                   {
                        
    dock 'top',
                        
    xtype'toolbar',
                        
    ui   'light',
                        
    items: [
                            {
                                
    text'Test Button'
                            
    }
                        ]
                    }
                ],

                
    html'Testing' 
           
    });

      
    this.getViewport().add([Dashboard]);   //Works! 
    But, If I move this configuration into a file, and try to include it as follows, it does not render.

    The file;
    PHP Code:
    Ext.define('PowerDashboard.view.ProjectDashboard',  {
        
    extend      'Ext.Panel',
        
    xtype       'project-dashboard',
        
    alias       'dashboard.widget',
        
    fullscreen  true,
         
    items: [
            {
                
    dock 'top',
                
    xtype'toolbar',
                
    title'Standard Titlebar'
            
    }, 
           {
                
    dock 'top'
               
    xtype'toolbar',
                
    ui   'light',
                
    items: [ 
                   { 
                       
    text'Test Button' 
                   
    }
              ] 
          } 
       ],
       
    html'Testing'
    }); 
    And how I try to include it.

    PHP Code:
      var Dashboard Ext.create('PowerDashboard.view.ProjectDashboard', {});
     
    this.getViewport().add(Dashboard); 
    Any guidance, would be greatly appreciated.

  2. If you are defining a component, all configurations should be inside a config: {} object.

    Code:
    Ext.define('MyComponent', {
        xtype: 'mycomponent',
        extend: 'Ext.Component',
        
        config: {
            fullscreen: true
            ...
        }
    });

  3. #2
    Sencha - Sencha Touch Dev Team rdougan's Avatar
    Join Date
    Oct 2008
    Posts
    1,158
    Answers
    93
    Vote Rating
    6
    rdougan will become famous soon enough

      0  

    Default


    If you are defining a component, all configurations should be inside a config: {} object.

    Code:
    Ext.define('MyComponent', {
        xtype: 'mycomponent',
        extend: 'Ext.Component',
        
        config: {
            fullscreen: true
            ...
        }
    });
    Sencha Inc.
    Robert Dougan - @rdougan
    Sencha Touch 2 and Ext JS 4 Core Team Member, SASS/Theming Wizard.

  4. #3
    Sencha User
    Join Date
    Jun 2009
    Location
    Burlington, Ontario
    Posts
    174
    Answers
    3
    Vote Rating
    2
    Bleak is on a distinguished road

      0  

    Default


    You are awesome, thank you.

Thread Participants: 1

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..."