I am trying to filter an html table on column values (vertically like MS Excel filter). I thought following code would work. It is failing, can someone help me understand why it is failing?
Error:
$("tr").each.find is not a function [Break On This Error]
$('tr').each.find('td').eq(coli)(function() {
the header row of the table has diff class applied to it, and body has diff class applied, if it matters...
rowi = this.rowIndex;
var coli = e.target.cellIndex;
cellval = $('tr').eq(rowi).find('td').eq(coli).text();
$("#filterbutton").click(function() {
var row = new Array();
$('tr').each.find('td').eq(coli)(function() {
if ($(this).text() == cellval) { // you can add aditional filter criteria... || $(this).text() == 50) {
row.push($(this).index());
}
});
$('th,td').each(function() {
if (($.inArray($(this).index(), row)==-1) && ($(this).index() != '0')){$(this).hide();}
});
});