1. #1
    Sencha User
    Join Date
    Feb 2008
    Location
    @bryanzarzuela
    Posts
    55
    Vote Rating
    0
    bzarzuela is on a distinguished road

      0  

    Question How do you properly use the config pre-processor in Ext.define?

    How do you properly use the config pre-processor in Ext.define?


    Here's a snippet of the coffeescript:

    Code:
    Ext.define 'nso.view.Viewport'
      extend: 'Ext.container.Viewport'
      
      config: 
        layout: 'fit'
        items: [
          {
            xtype: 'panel'
            title: 'this is a test'
          }
        ]
    The assumption is that it will automatically create a viewport with a single panel in it. However, that code does nothing. This though, works:

    Code:
    Ext.define 'nso.view.Viewport'
      extend: 'Ext.container.Viewport'
      
      initComponent: ()->
        this.items = [
          {
            xtype: 'panel'
            title: 'how come this works'
          }
        ]
        
        this.callParent(arguments)
    Am I missing something here?

  2. #2
    Sencha User
    Join Date
    Feb 2008
    Location
    @bryanzarzuela
    Posts
    55
    Vote Rating
    0
    bzarzuela is on a distinguished road

      0  

    Default


    This doesn't work as well:

    Code:
    Ext.define 'nso.view.Viewport'
      extend: 'Ext.container.Viewport'
      
      config: 
        items: [
          {
            xtype: 'panel'
            title: 'this is a test'
          }
        ]
      
      constructor: (config)->
        this.initConfig(config)
        return this

Similar Threads

  1. Setting Config Options when using Ext.define
    By kylemhall in forum Ext: Discussion
    Replies: 4
    Last Post: 24 Sep 2011, 6:46 AM
  2. Model Processor example?
    By hiinsu in forum Ext GWT: Discussion
    Replies: 2
    Last Post: 9 Aug 2010, 8:10 AM
  3. Status Bar - Word Processor example
    By sanjshah in forum Ext 3.x: Help & Discussion
    Replies: 0
    Last Post: 30 Aug 2009, 10:38 AM
  4. Enhancement Idea - Define custom events in config
    By Neville Burnell in forum Community Discussion
    Replies: 9
    Last Post: 15 Aug 2008, 6:27 AM
  5. where define Object config
    By ttl_web in forum Ext 1.x: Help & Discussion
    Replies: 1
    Last Post: 6 Sep 2007, 4:45 PM
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..." hd porno faketaxi