1. #1
    Sencha User
    Join Date
    Jun 2009
    Location
    Burlington, Ontario
    Posts
    173
    Answers
    1
    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
    173
    Answers
    1
    Vote Rating
    2
    Bleak is on a distinguished road

      0  

    Default


    You are awesome, thank you.

Thread Participants: 1

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar