Hi i used the below code to calculate total, but when it goes to the next page it calculate the total of that page only.
function calcTotal() {
var value = fd.control('SPDataTable1').widget.dataItems();
var total = 0;
if(value){
for (var i = 0; i < value.length; i++){
if(value[i].Amount)
total += parseFloat(value[i].Amount.replace(/(?!^-)[^0-9.]/g, "").replace(/(\..*)\./g, '$1'));
}
}
fd.field('Total').value = total;
}
first page total was 1000 and when i add contents to the second page the total becomes 200. The output should be 1000+200 = 1200
How do i calculate the whole total regardlsess of which page it is? and also how do i disable paging?