1. #1
    Sencha User silveralecs's Avatar
    Join Date
    Apr 2012
    Posts
    32
    Vote Rating
    1
    silveralecs is on a distinguished road

      0  

    Default Get config vars sent when initializing the component

    Get config vars sent when initializing the component


    I created a custom component, with a custom xtype, and I want to get all the variables sent when the component is initialized. All those variables will be used to instantiate another component. Here's an example:
    Code:
    {
      xtype: 'myCustomField',
      var1: 'test',
      var2: 'test2',
      ....
    }
    In the initComponent method of the component 'myCustomField' I want to retrieve ONLY the variables that we're sent when the component was initialized, no matter what their name is, or how many are they.
    getInitialConfig() doesn't work.

    Thank you,
    Alexandru

  2. #2
    Sencha Premium Member skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,580
    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


    Trying to merge the configurations of 2 components into one, flat config object plays havoc with the 'config overriding the prototype' paradigm at the heart of how initComponent is designed. Form panel has been a nuisance for years because it adopted this kind of approach.

    A common technique for config options like this is to wrap them in their own object. Examples include the boundlist on a combobox or the view for a grid.

    e.g.:

    Code:
    {
        xtype: 'myCustomField',
    
        blahConfig: {
            var1: 'test',
            var2: 'test2'
        }
    }

  3. #3
    Sencha User silveralecs's Avatar
    Join Date
    Apr 2012
    Posts
    32
    Vote Rating
    1
    silveralecs is on a distinguished road

      0  

    Default


    Thank you very much for your reply. This is exactly what I did.
    Though, it would be nice to have them directly into the root of the object.

Thread Participants: 1

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