I was not able to get your sample code to work.
However, I believe I see your problem. You have a massive unordered table that you are trying to filter. But some of the filters you need to set are hundreds of rows from the top in random order making it hard to find the item which you want to filter.
Assuming that the above is correct, it looks like you need to sort your table before you try to filter it.
On this page (
there is a demo which is sortable AND filterable. Look at demo 2 and notice how it works. I think that is what you need.
Then look at the source code for that demo. Here is a copy of the first part of the source code from that demo:
[tt]
[blue]
<html>
<head>
<title>TableFilter demo</title>
<script type='text/javascript' src='src/tablefilter.js'></script>
[red]<script type='text/javascript' src='lib/sorttable.js'></script>[/red]
<script type='text/javascript'>
//<![CDATA[
function tablefilter_init() {
TableFilter.makeFilterable( 'test_table_text_sorttable', 0 );
TableFilter.makeFilterable( 'test_table_image_sorttable', 0 );
}
addEvent( window, "load", tablefilter_init );
//]]>
</script>
<style>
table.sortable a.sortheader {
background-color:#eee;
color:#666666;
font-weight: bold;
text-decoration: none;
display: block;
}
table.sortable span.sortarrow {
color: black;
text-decoration: none;
}
.tablefilter_reset {
background-color: #eeeeee;
color: #666666;
text-decoration: underline;
cursor: pointer;
}
</style>
</head>
<body>
<table width="100%">
<tr>
<td valign="top">
Filter table rows based on text, with <a href=" title="sorttable">sorttable</a> also running.
<br/>
[/blue][/tt]
Note the line I highlighted in
[red]RED[/red]. That is another javascript file you must use in conjunction with tablefilter.js to obtain the results shown in demo 2.
The
ORANGE highlighted line shows where you can obtain the sortable javascript file.
Once you add that file and get the bugs worked out, I think your problem will be solved.
mmerlinn
"We've found by experience that people who are careless and sloppy writers are usually also careless and sloppy at thinking and coding. Answering questions for careless and sloppy thinkers is not rewarding." - Eric Raymond
Poor people do not hire employees. If you soak the rich, who are you going to work for?