PDA

View Full Version : Access value after rendering



Shaguar
26 Apr 2008, 6:27 AM
Hi,
can i access to the value of a cell after it is rendered?
Example:
Grid-Cell value before calling a custom render function : "TestValue"
Render function:


function renderCell(value)
{
return "Some " + value;
}
(after calling the render function : "Some TestValue")
With Grid.getStore().getAt(rowIndex).get('column') i only get "TestValue" but how can access the "Some" value?

evant
26 Apr 2008, 6:32 AM
http://extjs.com/deploy/ext-2.1/docs/?class=Ext.grid.GridView&member=getCell

Shaguar
26 Apr 2008, 6:43 AM
thx,
and how can i access to another cell in the same row while rendering this cell?
e.g.


function renderFunction(data, record)
{
if (record.get('anotherColumn') == 'test') {
return "One" + data;
else
return "Two" + data;

}

evant
26 Apr 2008, 6:48 AM
The same way?

Shaguar
26 Apr 2008, 6:58 AM
hmm,
but how can find out in the render function in which row i currently am?
or if this column isnt defined in the columnModel only in the record data object?

evant
26 Apr 2008, 7:01 AM
Read the docs: http://extjs.com/deploy/ext-2.1/docs/?class=Ext.grid.ColumnModel&member=setRenderer

Shaguar
26 Apr 2008, 8:52 AM
ofc, thanks a lot