1. #1
    Sencha User
    Join Date
    Mar 2010
    Posts
    249
    Vote Rating
    1
    Ex_Soft is an unknown quantity at this point

      0  

    Default [4.2.0beta] Ext.view.Table.refreshSize() error

    [4.2.0beta] Ext.view.Table.refreshSize() error


    Code:
        refreshSize: function() {
            var me = this,
                grid,
                bodySelector = me.getBodySelector();
    
            // On every update of the layout system due to data update, capture the view's main element in our private flyweight.
            // IF there *is* a main element. Some TplFactories emit naked rows.
            if (bodySelector) {
                me.body.attach(me.el.child(bodySelector, true));
            }
    
            if (!me.hasLoadingHeight) {
                grid = me.up('tablepanel');
    
                // Suspend layouts in case the superclass requests a layout. We might too, so they
                // must be coalescsed.
                Ext.suspendLayouts();
    
                me.callParent();
    
                // If the OS displays scrollbars, and we are overflowing vertically, ensure the
                // HeaderContainer accounts for the scrollbar.
                // If we need to measure row heights, update the layout
                if (grid && 
                    (Ext.getScrollbarSize().width && me.scrollFlags.y) ||
                    (grid.lockable && grid.syncRowHeight)
                ) {
                    grid.updateLayout();
                }
    
                Ext.resumeLayouts(true);
            }
        },
    if grid is undefined
    Code:
     (grid.lockable && grid.syncRowHeight)
    TypeError: grid is undefined
    Maybe should be
    Code:
                if (grid && 
                    ((Ext.getScrollbarSize().width && me.scrollFlags.y) ||
                    (grid.lockable && grid.syncRowHeight))
                )
    ?

  2. #2
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    16,797
    Vote Rating
    602
    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

      0  

    Default


    In what case is grid undefined? Please post a test case.
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  3. #3
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,499
    Vote Rating
    47
    Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    This is moot anyway now. The grid always has to be layed out, so there's no conditional there now.

  4. #4
    Sencha User
    Join Date
    Mar 2010
    Posts
    249
    Vote Rating
    1
    Ex_Soft is an unknown quantity at this point

      1  

    Default


    However, the condition itself
    Code:
    var
      a = undefined,
      b = false;
    
    if(a && b || a.smthProperty)
      alert("1");
    is incorrect, IMHO...

  5. #5
    Sencha User
    Join Date
    Nov 2010
    Location
    Ukraine
    Posts
    11
    Vote Rating
    0
    NexusOne is on a distinguished road

      0  

    Default


    I have the same problem when I trying to close the window.
    Notice I set autoDestroy=true to my store. If it's false everything gone Ok :-?

    Code:
        Ext.define('Employee', {
            extend: 'Ext.data.Model',
            fields: [
                {name: 'rating', type: 'int'},
                {name: 'salary', type: 'float'},
                {name: 'name'}
            ]
        });
    
        Ext.onReady(function(){
    
            function createFakeData(count) {
                var firstNames   = ['Ed', 'Tommy', 'Aaron', 'Abe', 'Jamie', 'Adam', 'Dave', 'David', 'Jay', 'Nicolas', 'Nige'],
                        lastNames    = ['Spencer', 'Maintz', 'Conran', 'Elias', 'Avins', 'Mishcon', 'Kaneda', 'Davis', 'Robinson', 'Ferrero', 'White'],
                        ratings      = [1, 2, 3, 4, 5],
                        salaries     = [100, 400, 900, 1500, 1000000];
    
                var data = [];
                for (var i = 0; i < (count || 25); i++) {
                    var ratingId    = Math.floor(Math.random() * ratings.length),
                            salaryId    = Math.floor(Math.random() * salaries.length),
                            firstNameId = Math.floor(Math.random() * firstNames.length),
                            lastNameId  = Math.floor(Math.random() * lastNames.length),
    
                            rating      = ratings[ratingId],
                            salary      = salaries[salaryId],
                            name        = Ext.String.format("{0} {1}", firstNames[firstNameId], lastNames[lastNameId]);
    
                    data.push({
                        id: 'rec-' + i,
                        rating: rating,
                        salary: salary,
                        name: name
                    });
                }
                return data;
            }
    
    
            var store = Ext.create('Ext.data.Store', {
                id: 'store',
                buffered: true,
                autoDestroy: true,
                pageSize: 5000,
                data: createFakeData(5000),
                model: 'Employee',
                proxy: {
                    type: 'memory'
                }
            });
    
            var grid = Ext.create('Ext.grid.Panel', {
                width: 700,
                height: 500,
                store: store,
                loadMask: true,
                selModel: {
                    pruneRemoved: false
                },
                viewConfig: {
                    trackOver: false
                },
                //plugins: "bufferedrenderer",
                columns:[{
                    xtype: 'rownumberer',
                    width: 40,
                    sortable: false
                },{
                    text: 'Name',
                    flex:1 ,
                    sortable: true,
                    dataIndex: 'name'
                },{
                    text: 'Rating',
                    width: 125,
                    sortable: true,
                    dataIndex: 'rating'
                },{
                    text: 'Salary',
                    width: 125,
                    sortable: true,
                    dataIndex: 'salary',
                    align: 'right',
                    renderer: Ext.util.Format.usMoney
                }]
            });
    
            var win = Ext.create('Ext.window.Window', {
                title: '[4.2.0beta] Ext.view.Table.refreshSize() error:',
    
                items: grid,
                layout: 'fit',
                autoDestroy: true,
                padding: 1,
                constrain: true,
                maximizable: true,
                closeAction:'destroy',
                autoShow: true
            });
        });

  6. #6
    Sencha User
    Join Date
    Nov 2010
    Location
    Ukraine
    Posts
    11
    Vote Rating
    0
    NexusOne is on a distinguished road

      0  

    Default


    Ok then. When store is autoDestroy = true, gridPanel tried to kick store on grid.destroy (you die with me!). Everything is ok until store is not buffered.

    But when store is buffered it create PageMap and then we have following behavior:
    1. I call gridPanel.destroy()
    2. gridPanel.destroy kick children (call gridView.destroy)
    3. gridView.destroy call gridView.ownerCt.remove(me) and then call store.destroyStore
    4. store.destroyStore call store.clearData
    5. store.clearData call store.data.clear (PageMap.clear method)
    6. PageMap.clear call parent method (Ext.util.HashMap.clear) which fire 'clear' event.
    7. store listen that event with method store.onPageMapClear and fire it own 'clear'
    8. gridView got that 'clear' event and tried to refresh
    9. gridView.refresh call gridView.refreshSize which call gridView.up('tablepanel');
    10. and here we are! gridView.ownerCt is null... (see step 3!!!)

Thread Participants: 3

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