Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted on May 13, 2009 00:56
open dhtmlx forum
groupby

after groupby i want to show for each group how much percentage contributing from all groups

ex :

- Name 1 (3) 60%
row 1
row 2
row 3
- Name 2 (2) 40%
row 4
row 5

how can i show each group percentage ?
Answer posted on May 13, 2009 01:39

It can be done using custom format for grouping:

 mygrid.customGroupFormat=function(name,count){
  var total=mygrid.getRowsNum();
  var percent=Math.round((count*100)/total);
  return name+"(" +count+ ")"+percent+"%";
  }