I have a gridpanel with columns (months: june until december) in each cell of column I done a simple processing my problem if I make it in the converter (of the field of my model) it does not work :
var responses=record.responses();
var sum=0;
var nbResponses=0;
console.log('counts:'+responses.getCount());
for(var i=0;i<responses.getCount();++i){
var response=responses.getAt(i);
if(response.get('month')===0){
sum+=response.get('score');
++nbResponses;
}
}
var nb=Ext.Number.toFixed(sum/nbResponses,1);
if(isNaN(nb))
return '';
else return nb;
it always return '', I showed the responses.getCount() it will be 0, Now if I delete the converter and make this process in the renderer of the column it work and return me the correct value, my problem is if I let it in the renderer I can't access in this column for example (column 'jan') from another column because I have other column wish calculate the total of all month in the simple row so my grid panel is:
columns: jun|feb|..... |dec |total.
row1: 3 | 5| 000| 5| 13.
So you have any Idea and thanx. Thanx