PDA

View Full Version : [DHTML] HTML Table Filter Generator



koalyptus
07-05-2006, 03:42 PM
1) CODE TITLE: HTML Table Filter Generator

2) AUTHOR NAME/NOTES: Koalyptus

3) DESCRIPTION: This script adds to any html table a "filter by column" feature that enables users to filter and limit the data displayed within a long table. It even works on tables with uneven rows. The script automatically adds a filter grid bar at the top of the desired table.

4) URL TO CODE: http://mguglielmi.free.fr/scripts/TableFilter/TableFilter_EN.zip

5) URL TO DEMO: http://mguglielmi.free.fr/scripts/TableFilter/?l=en

Twey
07-05-2006, 04:00 PM
Ooh, I like this one. :) Very impressive. One suggestion: optionally allow regex?

ddadmin
07-06-2006, 05:47 AM
I agree, it's very nice. Since it's already featured (http://www.javascriptkit.com/script/script2/tablefilter.shtml) on our sister site JavaScript Kit, I'll probably forgo posting it to DD as well.

koalyptus
07-06-2006, 06:42 AM
Hi Twey! Could you please explain a little bit more precisely your suggestion ?

Twey
07-30-2006, 02:06 AM
Regular expressions, http://www.regular-expressions.info/. A very powerful syntax to allow matching of complex patterns. Probably not your average user's cup of tea (hence "optional") but power users will find it very useful.

mburt
07-30-2006, 02:37 AM
Yeah. For example, I can make a code to validate e-mails using for-loops and other stuff, but with Regular Expressions, I can use a couple of lines:

<script language="javascript">
function validateString(input) {
var string = /\w+\@\w+(\.\w{3})$/
if (string.test(input)) {alert("valid")}
else (alert("invalid"))
}
</script>

Twey
07-30-2006, 02:43 AM
A couple of lines that may or may not run. :p
<script type="text/javascript">
function validateString(input) {
var string = /\w+\@\w+(\.\w{3})$/;

if (string.test(input)) alert("valid");
else alert("invalid");
}
</script>Obviously this is example code, and the pattern leaves much to be desired.

mburt
07-30-2006, 02:46 AM
Yeah, you can obviously go in more depth with this