Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Agile on Oct 16, 2008 03:05
open dhtmlx forum
Sum of any column for slected rows

Hi,

I want to calculate sum of all the selected rows for particular column.How to do it?
Thanks.

-Agile
Answer posted by Support on Oct 16, 2008 06:39
var summ=0;
var ids = mygrid.getSelectedRowId().split("");
for (var i=0; i<ids.length; i++) 
   summ+=mygrid.cellById(ids[i],INDEX).getValue();

where INDEX - zero based index of necessary column