1. #1
    Ext JS Premium Member mcouillard's Avatar
    Join Date
    Jun 2008
    Location
    Bucks County, PA
    Posts
    103
    Vote Rating
    8
    mcouillard will become famous soon enough

      0  

    Exclamation 4.2.2 nightly 9/9 - can't lazy load plugins within initComponent - plugin.init fail

    4.2.2 nightly 9/9 - can't lazy load plugins within initComponent - plugin.init fail


    --update: solved--

    Windows 7, FF 23
    I edited /examples/grid/row-editing.js to duplicate this from the latest nightly version of 4.2.2.

    This works fine - you create the plugin ahead of time:
    Code:
    var rowEditing = Ext.create('Ext.grid.plugin.RowEditing', {
            ptype: 'rowediting',
            clicksToMoveEditor: 1,
            autoCancel: false
        });
    ...
    var grid = Ext.create('Ext.grid.Panel', {
    ...
    plugins: [rowEditing],
    This fails - you create the plugin during grid initComponent (very common in large apps):
    Code:
    var grid = Ext.create('Ext.grid.Panel', {
    ...
    initComponent: function() {
                this.plugins = [{
                    ptype: 'rowediting',
                    clicksToMoveEditor: 1,
                    autoCancel: false
                }];
                this.callParent(arguments);
                //no errors in console until sometime after this
            }

  2. #2
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    16,791
    Vote Rating
    599
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      1  

    Default


    This isn't specific to the nightly, the same behaviour happens in at least as far back as 4.2.0.

    It's because you're copying over the prototype initComponent method. During class definition, the class system sets up references so that callParent() can link to the superclass method appropriately.

    In this case, all those references get overridden because initComponent is a new, unprocessed method. As such, when you callParent() inside it, it defaults back to the calling method because it can't find any of the class system references.

    So basically, initComponent ends up calling the base constructor instead of the parent initComponent method.
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  3. #3
    Ext JS Premium Member
    Join Date
    May 2010
    Location
    Wiesbaden
    Posts
    17
    Vote Rating
    0
    CSC-Germany is on a distinguished road

      0  

    Default


    Quote Originally Posted by evant View Post
    This isn't specific to the nightly, the same behaviour happens in at least as far back as 4.2.0.
    ....
    I have noticed the same issue. But it still worked until the nightly build 4.2.2.977.
    Additionally I can mention that I used 2 plugins... and one of the plugins is initialized, but the second isn't..

  4. #4
    Ext JS Premium Member mcouillard's Avatar
    Join Date
    Jun 2008
    Location
    Bucks County, PA
    Posts
    103
    Vote Rating
    8
    mcouillard will become famous soon enough

      0  

    Default


    Thank you for the detailed reply. I should have noted that it worked in 4.1.2a

    The new method I'm using in our app is to define plugins within our base defined grid's initComponent. I also tested by updating the Ext example to use a defined grid which had initComponent and it used the lazy load method of ptype just fine.

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