Hybrid View

  1. #1
    Sencha User talha06's Avatar
    Join Date
    Jul 2009
    Location
    Turkey
    Posts
    303
    Answers
    8
    Vote Rating
    0
    talha06 is on a distinguished road

      0  

    Default Unanswered: Override field at framework level

    Unanswered: Override field at framework level


    Hello everyone,

    I want to apply a plugin to all fields(numberfield, textfield, datefield, etc.) in the library ExtJS 4.1. Is there anyone who knows how can I do this?
    As I know, all fields are extended from BaseField. So I tried this; but it didn't work at all. I'll be happy if someone can guide me.Thanks in advance.
    Code:
    Ext.form.BaseField.override({
    	init	: function() {
    		this.plugins = [ 'clearbutton' ];
    	}
    });
    "People will never forget how you made them feel."
    linkedin.com/in/talhakabakus

  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


    You should be able to override using one of the following in Ext4

    Code:
    Ext.define('Ext.form.MyBaseField', {
        override: 'Ext.form.field.Base',
        functionToOverride: function (id) {
        }
    });
    Code:
    Ext.override(Ext.form.field.Base, {
        functionToOverride: function (id) {
        }
    });
    Regards,
    Scott.

  3. #3
    Sencha Premium Member skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,579
    Answers
    540
    Vote Rating
    314
    skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future

      0  

    Default


    You may have more luck trying to override initComponent rather than init, I'm not sure init exists. Be sure to call the overridden method too or you'll get all sorts of problems.

  4. #4
    Sencha User talha06's Avatar
    Join Date
    Jul 2009
    Location
    Turkey
    Posts
    303
    Answers
    8
    Vote Rating
    0
    talha06 is on a distinguished road

      0  

    Default


    First of all, thanks a lot for your care.

    @scottmartin
    I'm not going to override a function; I just want to add a global config to all fields with overriding Ext.form.BaseField..

    @skirtle
    I've already tried to override initComponent function too..
    "People will never forget how you made them feel."
    linkedin.com/in/talhakabakus

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