PDA

View Full Version : Send values using a renderer



reyes_edward
20 Feb 2009, 8:45 AM
Hello everybody ...
When you retrieve data and put in the GRID
only recover 'n_meta' and 'n_m00'
It is possible that when retrieving the data to make an operation using the renderer and burn in 'n_porc' ===> (n_meta / n_m00) * 100



function pctAvance(val){
return val;
}

var Grid = new Ext.grid.EditorGridPanel({
store: Inicio,
title:'Actividades',
....
columns: [
{header: "Programado",dataIndex: 'n_meta', width: 70, align: 'right'},
{header: "Ejecutado",dataIndex: 'n_m00', width: 70, align: 'right'},
{header: "%",dataIndex: 'n_porc', renderer: pctAvance, width: 70, align: 'right'}]

mjlecomte
20 Feb 2009, 10:22 AM
Try calculated fields:
http://extjs.com/forum/showthread.php?p=135345#post135345

Or perhaps use "convert" http://localhost/ext/v3/docs/?class=Ext.data.Record&member=create