Hybrid View

    Looks like we can't reproduce the issue or there's a problem in the test case provided.
  1. #1
    Ext JS Premium Member
    Join Date
    Sep 2011
    Posts
    25
    Vote Rating
    0
    dmurat is on a distinguished road

      0  

    Default [4.1B3] Bug with initComponent method of dataview

    [4.1B3] Bug with initComponent method of dataview


    With dataview example taken from documentation, if initComponent method is added to a dataview, TypeError is thrown:

    Code:
    Ext.onReady(function() {
      Ext.define('Image', {
        extend: 'Ext.data.Model',
        fields: [
          { name:'src', type:'string' },
          { name:'caption', type:'string' }
        ]
      });
      
      Ext.create('Ext.data.Store', {
        id:'imagesStore',
        model: 'Image',
        data: [
          { src:'http://www.sencha.com/img/20110215-feat-drawing.png', caption:'Drawing & Charts' },
          { src:'http://www.sencha.com/img/20110215-feat-data.png', caption:'Advanced Data' },
          { src:'http://www.sencha.com/img/20110215-feat-html5.png', caption:'Overhauled Theme' },
          { src:'http://www.sencha.com/img/20110215-feat-perf.png', caption:'Performance Tuned' }
        ]
      });
      
      var imageTpl = new Ext.XTemplate(
          '<tpl for=".">',
            '<div style="margin-bottom: 10px;" class="thumb-wrap">',
              '<img src="{src}" />',
              '<br/><span>{caption}</span>',
            '</div>',
          '</tpl>'
      );
      
      Ext.create('Ext.view.View', {
        store: Ext.data.StoreManager.lookup('imagesStore'),
        tpl: imageTpl,
        itemSelector: 'div.thumb-wrap',
        emptyText: 'No images available',
        renderTo: Ext.getBody(),
        
        // bug: plain initComponent causes throwing a TypeError
        initComponent: function() {
          this.callParent();
        }
      });
    });
    Upon execution above code throws following:
    Code:
    Uncaught TypeError: Cannot call method 'fill' of undefined
      Ext.define.refreshext-all-debug.js:59347
      Base.implement.callParentext-all-debug.js:3609
      Ext.define.refreshext-all-debug.js:100851
      (anonymous function)ext-all-debug.js:59578
      (anonymous function)
    Damir Murat

  2. #2
    Sencha - Community Support Team mankz's Avatar
    Join Date
    Nov 2007
    Location
    Stockholm, Sweden
    Posts
    2,734
    Vote Rating
    104
    mankz is a name known to all mankz is a name known to all mankz is a name known to all mankz is a name known to all mankz is a name known to all mankz is a name known to all

      0  

    Default


    Never use initComponent when instantiating a class, use it when _defining_ a class.

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..." hd porno faketaxi