1. #1
    Ext JS Premium Member
    Join Date
    Apr 2011
    Posts
    7
    Vote Rating
    0
    JoepRonde is on a distinguished road

      0  

    Default Unanswered: Extending a class other than ExtJS (like OpenLayers.Map)

    Unanswered: Extending a class other than ExtJS (like OpenLayers.Map)


    In ExtJS 3.2  I extended a class which is not part of the ExtJS framework (the OpenLayer.Map class) with the folowing code:

    Code:
    MyMap = Ext.extend(OpenLayers.Map, {
        constructor: function() {
            config = {
                div: 'olMap',
                projection: 'EPSG:28992'
                // ... other config settings
            }
            MyMap.superclass.constructor.call(this, config)
        },
    
        myFunction: function() {
            //Do something
        }
    });
    This all worked fine, the constructor above created a OpenLayer.Map instance and returned it. But now I'm upgrading to ExtJS 4 and would like to do exactly the same, but I can't make it work. The code I have so far is this:

    Code:
    Ext.define('MyMap', {
        extend: 'OpenLayers.Map',
        constructor: function() {
            config = {
                div: 'olMap',
                projection: 'EPSG:28992'
                // ... other config settings
            }
            this.callParent(arguments);
            this.initConfig(config);
        },
    
        myFunction: function() {
            //Do something
        }
    });
    The constructor above doesn't create return an instance of OpenLayers.Map though. I thought that this.callParent in the constructor should create a instance it's parent class (OpenLayer.Map), but is does not. So now I am wondering how can I extend a class other than an ExtJS class?

  2. #2
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    8,927
    Answers
    656
    Vote Rating
    443
    scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future

      0  

    Default


    Move to Q&A, plugins is for release.

    Scott.

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