0

I have the grid with two columns: Target and Target Percentage. I am getting Target value from store. I need to calculate Total and Target percentage value using Jan/Total Jan*100. I want a summary for target %. Can anybody tell me how to do this?

I need to calculate the total manually

E.g

Month  Target      Target %
   Jan     50       **50/100*100**
   Mon     50       50/100*100
   Total   100        

Thanks

Illidanek
  • 996
  • 1
  • 18
  • 32
mohan
  • 13,035
  • 29
  • 108
  • 178

1 Answers1

0

Probably you want this in your model.

{
    name : 'Target %',
    convert : function( value, record ) {
                   var target = (record.get('Target')/total)*100;
                   return target;
    }   
    type: 'number'
},
Dev
  • 3,922
  • 3
  • 24
  • 44
  • ohh sorry my bad,I didnt see the total field.Would it be a problem if the total is calculated server side and then loaded to the grid. – Dev May 22 '13 at 12:11
  • @Amit Aviv can u help me in this problem – mohan May 23 '13 at 12:27