Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var grid = jQuery('#list1');
- var sum,a, count=0;
- var ids = grid.jqGrid('getDataIDs');
- for (i = 0; i < ids.length; i++)
- {
- a = grid.jqGrid('getCell', ids[i], 'amount')
- if (a != 0)
- {
- sum += a;
- count++
- }
- }
- var avg = Math.round(sum/count,2);
- grid.jqGrid('footerData','set', {id: 'Avg: ' + avg});
Add Comment
Please, Sign In to add comment