Filtering individual table

Filtering individual table

tsantostsantos Posts: 2Questions: 0Answers: 0
edited June 2010 in General
I have multi-tables in my page and I setting up looks like this: $('.tables).dataTable(...);

For each table, I need to filter using the fnFilter(..) function, but when I filter one table, all others filter too. The filter is checkboxes in thead tag. The checkboxes have click event that start the filtering.

e.g:
[code]
$('.tables).dataTable();
$('thead th input', '.tables').each(function(i) {
var table = $(this).parent().parent().parent(); //table tag
$(this).click(function() {
table.fnFilter( $(this).val(), i);
});
});
[/code]

Replies

  • tsantostsantos Posts: 2Questions: 0Answers: 0
    Just correction.

    [code]
    $('.tables').dataTable();
    $('thead th', '.tables').each(function(i) {
    var table = $(this).parent().parent(); //table tag
    $('input', this).click(function() {
    table.fnFilter( $(this).val(), i);
    });
    });
    [/code]
This discussion has been closed.