Process hidden rows in a filtered table
Process hidden rows in a filtered table
I am using the DataTable with a text filter.
I have a set of rows each of which has an input box.
On the table footer I have a total which shows the total of the values entered.
I can use the filter to restrict the displayed rows based on the text entered in the filter text box.
The problem I am facing is that the total field does not sum up values in hidden rows when the filter is active.
So if I have 3 rows
A 10
AB 20
CC 70
And I have the filter set to A then the total shown is only 30 since only rows A and AB are visible.
I use a script to total the value like this
[code]
$(".input_field.buy").each(function(){
totBuyPct += parseFormattedFloat($(this).val());
});
[/code]
My question is: How can I process the hidden row CC as well?
Does DataTable have an api to iterate across all rows in the table including currently filtered rows?
/sanjay
I have a set of rows each of which has an input box.
On the table footer I have a total which shows the total of the values entered.
I can use the filter to restrict the displayed rows based on the text entered in the filter text box.
The problem I am facing is that the total field does not sum up values in hidden rows when the filter is active.
So if I have 3 rows
A 10
AB 20
CC 70
And I have the filter set to A then the total shown is only 30 since only rows A and AB are visible.
I use a script to total the value like this
[code]
$(".input_field.buy").each(function(){
totBuyPct += parseFormattedFloat($(this).val());
});
[/code]
My question is: How can I process the hidden row CC as well?
Does DataTable have an api to iterate across all rows in the table including currently filtered rows?
/sanjay
This discussion has been closed.