Hybrid View

  1. #1
    Ext JS Premium Member gevik's Avatar
    Join Date
    May 2009
    Location
    The Netharlands
    Posts
    265
    Vote Rating
    8
    gevik will become famous soon enough

      0  

    Exclamation Ext.Base:initConfig problem

    Ext.Base:initConfig problem


    The Ext.Base->initConfig method can be used to initialize configuration for a given class. However there is a problem in the implementation which I don't quite know whether it is a bug in that function or an inconsistency elsewhere in the framework. So here is an example:

    Code:
                Ext.define('MyWindow',{
                    extend:'Ext.window.Window',
                    alias:'widget.mywindow',
                    config: {
                        layout:'fit',
                        width:200,
                        height:200,
                        title:'MyWindow',
                        items:{                        
                            xtype:'button',
                            text:'Uber Button'
                        }
                    },
                    constructor:function(config) {
                        var me = this;
                        me.initConfig(config);
                        me.callParent(arguments);
                    }
                });
    In the example above, the code fails since initConfig will ultimately call "setLayout" as in setting a property called "layout", passing 'fit' (as a string), but deep in the component chain (AbstractContainer) there is already a function called "setLayout" which breaks since it needs an object (a fit layout object) instead of a "fit" as string.

    So where is the problem here you might ask? Should we fix the initConfig to check if we already have a function called "setXYZ" that is not a property setter or fix the "setLayout" function in the AbstractContainer?

    But wait... there is more....

    I can point to several other cases like this, for example "setProxy" and any other conbination where we can find a setXYZ function for a XYZ config.

    Any thoughts?

  2. #2
    Ext JS Premium Member
    Join Date
    Jan 2008
    Posts
    378
    Vote Rating
    2
    silcreval is on a distinguished road

      0  

    Default


    Good point. I've run into problems where I've used 'width' 'height' etc in config.

    It might be better to move some definitions into the constructor or initComponent, particularly where you are defining objects {}

  3. #3
    Ext JS Premium Member gevik's Avatar
    Join Date
    May 2009
    Location
    The Netharlands
    Posts
    265
    Vote Rating
    8
    gevik will become famous soon enough

      0  

    Default


    Quote Originally Posted by silcreval View Post
    Good point. I've run into problems where I've used 'width' 'height' etc in config.

    It might be better to move some definitions into the constructor or initComponent, particularly where you are defining objects {}
    Yes, unfortunately that is the way to go at the moment.

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