Hybrid View

  1. #1
    Ext JS Premium Member
    Join Date
    Oct 2010
    Posts
    103
    Vote Rating
    6
    abierbaum is on a distinguished road

      0  

    Default Unanswered: Documentation for mixins?

    Unanswered: Documentation for mixins?


    Is there documentation for how to use mixins? I have a situation where I think I want to use a mixin, but I can't find any documentation that tells me exactly how to do it or how it functions.

  2. #2
    Sencha User
    Join Date
    Mar 2007
    Posts
    411
    Answers
    5
    Vote Rating
    17
    jweber will become famous soon enough

      0  

    Default


    Here's a quick example (based on my reading of Sencha's code; I agree that we could use more documentation here):

    Code:
    Ext.define('MyMainClass', {
    	// the benefit is that you can add to your class with one
    	// or more mixins, rather than by extending another class
    	extend: 'MyParentClass',
    	mixins: {
    		myMixinIdentifier: 'MyMixinClass'
    	},
    	constructor: function(config) {
    		this.callParent(arguments);
    		// make sure you call this if your mixin has a constructor
    		this.mixins.myMixinIdentifier.constructor.call(this);
    	}
    });
    
    Ext.define('MyMixinClass', {
    	extend: 'Ext.mixin.Mixin',
    	mixinConfig: {
    		id: 'myMixinIdentifier'
    	},
    	config: {
    		// configs defined here will be added to MyMainClass instances
    	}
    	// methods defined here will be added to MyMainClass instances
    });

  3. #3
    Ext JS Premium Member
    Join Date
    Oct 2010
    Posts
    103
    Vote Rating
    6
    abierbaum is on a distinguished road

      0  

    Default


    Thanks for the quick reply. This is exactly what I wanted to see.

  4. #4
    Sencha User
    Join Date
    Mar 2013
    Location
    Shanghai China
    Posts
    1
    Vote Rating
    0
    Brooklyn Ji is on a distinguished road

      0  

    Default


    it is also helpful for me, thanks.

Thread Participants: 2

Tags for this Thread

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..."