Filtering individual table
Filtering individual table
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]
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]
This discussion has been closed.
Replies
[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]