PDA

View Full Version : Grid header disappears on row click



rafaelrp
9 Mar 2012, 4:33 AM
Good Morning,
I've make a grid in a collapsible panel but on rowclick the grid header dissapears, in fact it doesn't dissapears but hide on panel title, if i collpse and expand the header appears again.

panel where grid is rendered

{ region : 'south',
title : 'Grid',
id : 'southPanel',
xtype : 'panel',
autoWidth : true,
//autoScroll : true,
height : 200,
collapsible : true,
titleCollapse : true,
split : true,
html : '<div id="grid"></div>'
}

grid

Ext.create('Ext.grid.Panel', { store: store,
id: "panelGrid",
columns: [
{ header: '<b>Placa</b>', dataIndex: 'Placa' },
{ header: 'Referencia', dataIndex: 'Referencia' },
{ 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,
height: 200,
renderTo: "grid"
});

Thanks ~o)

Farish
9 Mar 2012, 5:53 AM
this might be happening since you have the same height for the grid and panel. try reducing the height of the grid to 150 and see if this problem still happens. Does it happen in Firefox too? If this works and if you only have the grid in this panel, dont put height in the grid; rather use the layout: 'fit' in the panel.

rafaelrp
9 Mar 2012, 6:03 AM
This problem happens only in chrome and ie, i'll try to reduce the height..

rafaelrp
9 Mar 2012, 6:22 AM
It works !

To avoid opening another thred another question..
there's a way to show panel tools where the panel is collapsed?

And another error this time on Firefox, when i collapse the panel where's panel in this error appears...

H is null
What may be this error?

And another question..
In Firefox, ext is very slow when i render the grid, there's a way to ext does't get slow?

Thanks ! ~o)

Farish
9 Mar 2012, 6:50 AM
hmmm. no idea about this problem. i would recommend that you start a new thread with this problem. people tend to ignore reading threads which already has some replies.

rafaelrp
9 Mar 2012, 6:53 AM
Ok, Thanks with the help !

rafaelrp
9 Mar 2012, 6:57 AM
How can i mark this thread as answered?

Farish
9 Mar 2012, 7:12 AM
on the replies, you have some option to mark one reply as best answer. that will mark the thread as answered.

nextSTEP
24 Apr 2012, 3:49 AM
I got the same problem, but the solution provided here did not solve my problem.
Instead the following solved it for me:


grid.on("render", function(view) {
view.ownerCt.doLayout();
}, this, { delay : 10 });