Gelmiş geçmiş en büyük porno sitemiz olan 2pe de her zaman en kaliteli pornoları sunmayı hedefledik. Diğer video sitemiz olan vuam da ise hd porno ağırlıklı çalışmalara başladık.

  1. #1
    Sencha User ilija139's Avatar
    Join Date
    Aug 2011
    Location
    Macedonia
    Posts
    36
    Vote Rating
    0
    ilija139 is on a distinguished road

      0  

    Default Having `constructor: function(config) ` in custom Container doesn't work in iOS 5

    Having `constructor: function(config) ` in custom Container doesn't work in iOS 5


    I have a class that is extended from Ext.Container. If I have the
    Code:
     constructor: function(config){}
    then the app doesn't work only in iOS 5 Safari. I get the following error
    Code:
    TypeError: '[object Object]' is not a valid argument for 'Function.prototype.apply'
    I have tried using:
    Code:
     initialize:function(){
             var config = this.getInitialConfig();
                ...
    }
    And it works, but if I call
    Code:
    this.callParent(config);
    (although I don't longer need to) I get the same error.

  2. #2
    Sencha User
    Join Date
    Mar 2007
    Location
    Haarlem, Netherlands
    Posts
    1,243
    Vote Rating
    9
    TommyMaintz will become famous soon enough TommyMaintz will become famous soon enough

      0  

    Default


    Can you please post the code that is extending the Container? It will be easier for us if you showed us the entire Class.

  3. #3
    Sencha User ilija139's Avatar
    Join Date
    Aug 2011
    Location
    Macedonia
    Posts
    36
    Vote Rating
    0
    ilija139 is on a distinguished road

      0  

    Default


    Here is the entire code:

    Code:
    Ext.define('Bugs.view.NewView', {
        extend: 'Ext.Container',
        xtype: 'newview',
    
    
        config:{
            html:'hi'
        },
    
    
        //Having this here throws TypeError: '[object Object]' is not a valid argument for 'Function.prototype.apply'
        //in iOS 5 simulator. 
        constructor:function(config) {
            //Works in chrome but the html property is hi not hello.
            this.callParent(config);
            console.log(config);
        }
    
    
    });
    
    Ext.define('Bugs.view.Viewport', {
        extend:'Ext.Container',
        config:{
            fullscreen:true,
            items:[
                {
                    xtype   : 'button',
                    text    : 'Show Popup',
                    centered: true
                },
                {
                    xtype   : 'newview',
                    html    : 'hello'
                }
            ]
        },
    
    
        initialize:function() {
            var config = this.getInitialConfig();
            console.log(config);
    
    
            //This in chrome is OK, but in iOS 5 simulator it's not. 
            //throws TypeError: '[object Object]' is not a valid argument for 'Function.prototype.apply'
            this.callParent(config);
        }
    });
    
    
    Ext.Loader.setConfig({ enabled: true });
    Ext.application({
        name: 'Bugs',
        launch: function() {
            Ext.create('Bugs.view.Viewport');
        }
    });

  4. #4
    Sencha User
    Join Date
    Mar 2007
    Location
    Haarlem, Netherlands
    Posts
    1,243
    Vote Rating
    9
    TommyMaintz will become famous soon enough TommyMaintz will become famous soon enough

      0  

    Default


    this.callParent expects an array of arguments to be passed to the parent method. Thats why in most of the framework code, if we need to just pass no the arguments to the parent we use the following:

    Code:
    this.callParent(arguments);
    If you however want to modify the items in the arguments or pass additional ones to the parent you should do the following:

    Code:
    this.callParent([config, someOtherArg]);
    You can look at the callParent docs for more information.

    Hope this helps you out.

  5. #5
    Sencha User ilija139's Avatar
    Join Date
    Aug 2011
    Location
    Macedonia
    Posts
    36
    Vote Rating
    0
    ilija139 is on a distinguished road

      0  

    Default


    That solved both issues, thanks!

Thread Participants: 1