PDA

View Full Version : Grid renderer columnheader



ThierryCor
31 Aug 2009, 4:39 AM
is there a way to retrieve the columnheader from within the render function ?
this is my colummodel




var colModelTurnOver = new Ext.grid.ColumnModel([
{id:'sessid',
dataIndex: 'B2SESSID',
width: 80,
hidden: true,
sortable: true},

{id: 'qto01',
dataIndex: 'B2QTO01',
width: 65,
align:'right',
header: "<b>2009/05</b>"
renderer:rndrVal,
sortable:true},

{id: 'qto02',
dataIndex: 'B2QTO02',
width: 65,
align:'right',
header: "<b>2009/06</b>"

renderer:rndrVal,
sortable:true},
....
{id: 'qto24',
dataIndex: 'B2QTO24',
width: 65,
align:'right',
header: "<b>2011/01</b>"

renderer:rndrVal,
sortable:true},

this my render function


function rndrVal(value, cell, row, rowIndex, colIndex, ds){
value+=" ";
if (value.substr(0, 1) == "(") {
value = value.replace('(', ' ');
value = value.replace(")", "");
cell.attr = 'style="background-color:#ffcc99;"';
}

if (value == ",00") {
value = '';
} else if(value < 0) {
return '<span style="color:red;">' + value + '</span>';
}
return value;
};
i would need the columnheader in the renderfunction ...
can this be done ?