Working on filtered set
Working on filtered set
Hi Allan,
I want work on the filtered set of data rows but am unable to find a way to do that. fnGetNodes returns all the nodes. The scenario in my case is that I have a checkbox column in each row and also on in the header (for select all). The user can either individually check the rows but if they want to select all then they can click on the checkbox in the header. So, I want to detect the rows which are currently visible through and mark all of them as checked.
Is there a way to do it?
Thanks.
I want work on the filtered set of data rows but am unable to find a way to do that. fnGetNodes returns all the nodes. The scenario in my case is that I have a checkbox column in each row and also on in the header (for select all). The user can either individually check the rows but if they want to select all then they can click on the checkbox in the header. So, I want to detect the rows which are currently visible through and mark all of them as checked.
Is there a way to do it?
Thanks.
This discussion has been closed.
Replies
At First I used fnGetNodes in my #check_all and it checked everything. From what I understand this is what is initially returned without a filter. So I tried fnGetDisplayNodes.
How can check off just the 100 records and loop through the 100 records?
[code]
$('#check_all').click(function () {
$('input', oTable.fnGetNodes ()).attr('checked', this.checked);
});
$('#btnrenew').click(function () {
$("input:checked", oTable.fnGetDisplayNodes()).each(function () {
console.log($(this).val());
});
return false;
});
[/code]
Thanks and hope this is clear
[code]
$.fn.dataTableExt.oApi.fnGetFilteredNodes = function ( oSettings )
{
var anRows = [];
for ( var i=0, iLen=oSettings.aiDisplay.length ; i
I implemented the code to check all the filtered rows, but it filters out only those that are on the first page and not the remaining sulel other pages you can give me a hand to solve the problem?
thanks