Add multiple numbers
Add multiple numbers
Hello Friends I am trying to add numbers in a cell 1000 but comes to adding to row 189 and I have no idea d because it does, someone could help me?
This is my code
Greetings and thank you very much
[code]
"fnDrawCallback": function() {
var saldomas=0;
var saldomenos=0;
$('#example tbody tr').each(function()
{
var poso = oTable.fnGetPosition(this);
var ido = oTable.fnGetData(poso)[8];
var valor = oTable.fnGetData(poso)[9];
if(ido==1 || ido==2)
{
saldomas +=parseFloat(valor);
}
else
{
saldomenos +=parseFloat(valor);
}
})
var saldo=saldomas-saldomenos
}
[/code]
This is my code
Greetings and thank you very much
[code]
"fnDrawCallback": function() {
var saldomas=0;
var saldomenos=0;
$('#example tbody tr').each(function()
{
var poso = oTable.fnGetPosition(this);
var ido = oTable.fnGetData(poso)[8];
var valor = oTable.fnGetData(poso)[9];
if(ido==1 || ido==2)
{
saldomas +=parseFloat(valor);
}
else
{
saldomenos +=parseFloat(valor);
}
})
var saldo=saldomas-saldomenos
}
[/code]
This discussion has been closed.
Replies
if I do this alert (oTable.fnGetNodes (). length) telling me I have 189 rows and I have actually 1000, and could make the 1000 rows showing me?