PDA

View Full Version : [UNKNOWN][3.0.3] grid column header with no text



dolittle
16 Dec 2009, 3:48 PM
Ext 3.0.3

When a column header is empty string and you hover with your mouse it turns to blue.
Try to change the grid in examples/grid/array-grid.js to:

// create the Grid
var grid = new Ext.grid.GridPanel({
store: store,
enableHdMenu: false,
columns: [
{id:'company'/*,header: "Company"*/, width: 160, sortable: false, dataIndex: 'company'},
{header: "Price", width: 75, sortable: true, renderer: 'usMoney', dataIndex: 'price'},
{header: "Change", width: 75, sortable: true, renderer: change, dataIndex: 'change'},
{header: "% Change", width: 75, sortable: true, renderer: pctChange, dataIndex: 'pctChange'},
{header: "Last Updated", width: 85, sortable: true, renderer: Ext.util.Format.dateRenderer('m/d/Y'), dataIndex: 'lastChange'}
],
stripeRows: true,
autoExpandColumn: 'company',
height:350,
width:600,
title:'Array Grid'
});

I've added enableHdMenu: false, commented the header of the first column and put sortable:false. Try to put your mouse over the first column header.

Now replace the first column with:

{id:'company'/*,header: "Company"*/, width: 160, sortable: false, menuDisabled: true, dataIndex: 'company'},

Now it works properly.

evant
16 Dec 2009, 4:46 PM
I'm not really clear on what you're saying here. Can you elaborate?

dolittle
16 Dec 2009, 4:54 PM
@evant
Try the array-grid.js example with my first block of code.
When you put the mouse cursor on the left column header you get the x-grid3-hd-over effect
but it looks weird because I put an empty string in the header text.

Condor
18 Dec 2009, 2:48 AM
Ext 3.1.0 override:

Ext.override(Ext.grid.GridView, {
renderHeaders : function(){
var cm = this.cm,
ts = this.templates,
ct = ts.hcell,
cb = [],
p = {},
len = cm.getColumnCount(),
last = len - 1;
for(var i = 0; i < len; i++){
p.id = cm.getColumnId(i);
p.value = cm.getColumnHeader(i) || '&#160;';
p.style = this.getColumnStyle(i, true);
p.tooltip = this.getColumnTooltip(i);
p.css = i === 0 ? 'x-grid3-cell-first ' : (i == last ? 'x-grid3-cell-last ' : '');
if(cm.config[i].align == 'right'){
p.istyle = 'padding-right:16px';
} else {
delete p.istyle;
}
cb[cb.length] = ct.apply(p);
}
return ts.header.apply({cells: cb.join(''), tstyle:'width:'+this.getTotalWidth()+';'});
}
});