PDA

View Full Version : Grid Collpase returns error in Firefox



rafaelrp
15 Mar 2012, 4:57 AM
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 ! ~o)

arthurakay
15 Mar 2012, 7:31 AM
Can you provide some code so I can attempt to reproduce the issue?

What version of Ext4?

rafaelrp
15 Mar 2012, 8:46 AM
v4.0.3

Here's the code, sorry but is panel collapse, not grid collapse.


{
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. ~o)

arthurakay
15 Mar 2012, 8:51 AM
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.

rafaelrp
15 Mar 2012, 9:15 AM
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)

arthurakay
15 Mar 2012, 9:16 AM
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.

rafaelrp
15 Mar 2012, 9:28 AM
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..


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 !

arthurakay
15 Mar 2012, 10:31 AM
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.

rafaelrp
15 Mar 2012, 11:08 AM
Ok, i'll do some more tests with firebug's breakpoints

Thanks ! ~o)