Results 1 to 9 of 9

Thread: Grid Collpase returns error in Firefox

  1. #1
    Sencha User
    Join Date
    Jun 2011
    Posts
    185
    Answers
    6

    Default Answered: Grid Collpase returns error in Firefox

    I not found a solution for this error in FF.
    When i collapse a panel, Firefox return me an error..
    el is null
    Only Firefox returns this error..


    Thanks !

  2. Nothing immediately jumps out at me as being wrong, but since you're using configs like "renderTo" it's possible that the issue stems from a DOM element not existing (either not yet created, or already destroyed) at the time you're attempting to collapse the panel.

    The stack trace in Firebug (or Chrome) is the only thing I can think of to help you. Without seeing a full blown example (i.e. a test case to reproduce the issue) I don't know how much more help I can offer.

  3. #2
    Sencha Developer
    Join Date
    Sep 2008
    Location
    Antioch, IL
    Posts
    1,516
    Answers
    99

    Default

    Can you provide some code so I can attempt to reproduce the issue?

    What version of Ext4?

  4. #3
    Sencha User
    Join Date
    Jun 2011
    Posts
    185
    Answers
    6

    Default

    v4.0.3

    Here's the code, sorry but is panel collapse, not grid collapse.
    Code:
    {            
    region : 'south',
                title: 'Grid',
                id : 'southPanel',
                xtype: 'panel',
                autoWidth: true,
                //autoScroll: true,
                height : 200,
                collapsible : true,
                titleCollapse: true,
                split: true,
                tools:[{
                    type:'maximize',
                    tooltip : 'plus',
                    // hidden:true,
                    handler : function(){
                            var heightBody             = Ext.getBody().getHeight();
                            var heightNorthPanel    = Ext.getCmp("menuToolbar").getHeight();
                            
                            if(activeMaximizar == "false"){
                                Ext.getCmp("southPanel").setHeight(heightBody-heightNorthPanel);
                                activeMaximizar = "true";
                            }
                            else{
                                Ext.getCmp("southPanel").setHeight(200);
                                activeMaximizar = "false";
                            }
                    }
                },

    A question, what files i need to overwrite to update from 4.0.3 to 4.1?

    Thanks.

  5. #4
    Sencha Developer
    Join Date
    Sep 2008
    Location
    Antioch, IL
    Posts
    1,516
    Answers
    99

    Default

    I see you're using getCmp() in that code... if I had to bet, that could be the root cause. "el is null" is telling you that some object you're trying to modify does not exist... so maybe one of those components either (1) has yet to be rendered, or (2) was already destroyed.

    Put a break point in Firebug and check the stack trace... which line is giving you the problem?

    Also, there's no magic "override" to get you from 4.0.3 to 4.1. A lot will have changed.

  6. #5
    Sencha User
    Join Date
    Jun 2011
    Posts
    185
    Answers
    6

    Default

    I've commented the lines with the getCmp() but the error continues..
    the firebug returns error in line 8216(in ext, not in my file)

  7. #6
    Sencha Developer
    Join Date
    Sep 2008
    Location
    Antioch, IL
    Posts
    1,516
    Answers
    99

    Default

    I realize the error comes in Ext, but using the stack trace you can walk backwards to see the last line in your own code that was executed. That's the place we need to identify.

    If it's not the getCmp() code, then at least we've narrowed down the possibilities.

  8. #7
    Sencha User
    Join Date
    Jun 2011
    Posts
    185
    Answers
    6

    Default

    i commented the grid code and firebug does not return the error..

    but i don't know what is wrong with the grid..


    Here's the code..
    Code:
    grid dataStore    var store = Ext.create('Ext.data.Store', {
            storeId:'gridVeiculos',
            fields:[
                "tipoVeiculo",
                "Placa",
                "Lat",
                "Lon",
                "Referencia",
                "Status", 
                "Localizacao",
                "Clima",
                "Situacao",
                "Operadora",
                "Condutor",
                "Empresa",
                "Obs",
                "Sleep"
                
            ],        
            data:{'items':[
                { "idPlaca":1, "Placa": "MAL0000",  "Referencia":"Cielo, no local", "Status":"Ativo",  "Localizacao":"Passo fundo", "Clima":"Sol", "Situacao":"Desligado", "Operadora":"Vivo", "Condutor":"Rafael Ranzolin", "Empresa":"Cieo Industria", "Obs":"Teste de observacao", "Sleep":"Desligado" },
    { "idPlaca":1, "Placa": "MAL0000",  "Referencia":"Cielo, no local", "Status":"Ativo",  "Localizacao":"Passo fundo", "Clima":"Sol", "Situacao":"Desligado", "Operadora":"Vivo", "Condutor":"Rafael Ranzolin", "Empresa":"Cieo Industria", "Obs":"Teste de observacao", "Sleep":"Desligado" },
    { "idPlaca":1, "Placa": "MAL0000",  "Referencia":"Cielo, no local", "Status":"Ativo",  "Localizacao":"Passo fundo", "Clima":"Sol", "Situacao":"Desligado", "Operadora":"Vivo", "Condutor":"Rafael Ranzolin", "Empresa":"Cieo Industria", "Obs":"Teste de observacao", "Sleep":"Desligado" }
            ]},    
            proxy: {
                type: 'memory',
                reader: {
                    type: 'json',
                    root: 'items'
                }
            }
        });
        
        //checkbox do grid
        var checkboxes = Ext.create("Ext.selection.CheckboxModel");
        
        //rendarizacao do grid
        Ext.create('Ext.grid.Panel', {
            store: store,
            id: "panelGrid",
            selModel: checkboxes,
            columns: [
                { 
                    header: '<b>Placa</b>',  
                    dataIndex: 'Placa'
                },
                { header: 'Referencia', dataIndex: 'Referencia' },
                { header: 'Lat', dataIndex: 'Lat' },
                { header: 'Lon', dataIndex: 'Lon' },
                { header: 'Status', dataIndex: 'Status' },
                { header: 'Localizacao', dataIndex: 'Localizacao' },
                { header: 'Clima', dataIndex: 'Clima' },
                { header: 'Situacao', dataIndex: 'Situacao' },
                { header: 'Operadora', dataIndex: 'Operadora' },
                { header: 'Condutor', dataIndex: 'Condutor' },
                { header: 'Empresa', dataIndex: 'Empresa' },
                { header: 'Obs', dataIndex: 'Obs', flex:1 },
                { header: 'Sleep', dataIndex: 'Sleep' },
                {
                    xtype: 'actioncolumn',
                    width: 50,
                    items: [{
                        icon   : 'imagens/16x16/accept.png',
                        tooltip: 'Ativo',
                        handler: function(grid, rowIndex, colIndex) {
                            var rec = store.getAt(rowIndex);
                            alert("Placa: " + rec.get('Placa'));
                        }
                    }]
                }
            ],
            autoScroll        : true,
            renderTo: "grid"
        });

    Thanks !

  9. #8
    Sencha Developer
    Join Date
    Sep 2008
    Location
    Antioch, IL
    Posts
    1,516
    Answers
    99

    Default

    Nothing immediately jumps out at me as being wrong, but since you're using configs like "renderTo" it's possible that the issue stems from a DOM element not existing (either not yet created, or already destroyed) at the time you're attempting to collapse the panel.

    The stack trace in Firebug (or Chrome) is the only thing I can think of to help you. Without seeing a full blown example (i.e. a test case to reproduce the issue) I don't know how much more help I can offer.

  10. #9
    Sencha User
    Join Date
    Jun 2011
    Posts
    185
    Answers
    6

    Default

    Ok, i'll do some more tests with firebug's breakpoints

    Thanks !

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •