Roundup: animated table sort / browser sniffing
With the exception of Blockster, the most popular script I've ever posted is my animated table sorter.
Which is rather odd, since as far as I'm aware it's buggy. Somehow, though, if the comments and e-mails are anything to go by, loads of people have been able to use it just fine.
Given this unexpected popularity I'm going to attempt to rebuild it in the coming months.
This script is among the top five hardest scripts I've written, so I'll, er, look forward to that.
In other news, stay tuned for my next script, later this week - a browser and plugin sniffer.
Browser sniffing is one of those things that you can't believe there still isn't a standard way of doing. Even jQuery's $.browser utility comes with a load of caveats warning that results might not be as expected.
And it's little wonder. Different browsers declare different, non-standard data in the various properties of the navigator object. Over the years these have led to some amusing revelations; if you ask Chrome what its navigator.appName is you'll get... Netscape. Naturally.
So I've been labouring away on a script that will provide you with something representing a reliable utility for this sort of thing. Not only with regards to detecting browser name but also other info such as language (more on that later...) and plugin support (and on that...).
post a commentTable sorter: toggling sort direction
A quick thanks to Saul, who took an interest in my table sort script and developed a way to toggle the sort direction when a column heading is re-clicked. That is, the first time it's clicked the table column is sorted in ascending order; if clicked again, in descending order.
For full details, check out Saul's comment on the script page over here.
post a commentTable sort update - sorting on child element
The reception to my animated table sort plugin, posted a few weeks ago, has been great. A number of blogs, articles and tweets have featured it.
Some people have asked if it's possible to sort on the content of a child element of each
So if each
1$('#example1_table').sortTable({
2 onCol: 1,
3 keepRelationships: true,
4 child: 'input'
5});
It's important that your selector matches only one element per
child: 'input.mytextfield'
Head over here to download, get usage info or view a demo.
post a commentTable sort - now REGEXP friendly
Just modified my animated table sort plugin to allow sorting on a regular expression match against the content of each
This would be hugely useful if, say, you had a table showing product categories and, for each, the number of products therein, in brackets, e.g. "Lawnmowers (15)".
You can also specify an index of the returned matches array to use for the sort, in case your REGEXP pattern returns more than one match or specifies a sub-pattern.
Head over here to download, get usage info or view a demo.
post a commentHello, world
I'm a London-based Javascript specialist, focussing on native JS, jQuery, XSL and related technologies.
Latest content
My projects/writings
XMLPlayground.com - a sandbox for XML development, including (E)XSLT, XQuery, DTD, Schema and more
- Ten Oddities and Secrets of JavaScript
- Commonly Confused Bits of jQuery
- Image Manipulation with jQuery and PHP-GD
- Get Serious with JavaScript: Learn RegExp (in print copies only)
- Catching Up with jQuery's Newer Versions (submitted for print...)
Archive
-
2012
-
Aug
-
Jul
-
Jun
-
May
-
Apr
-
Mar
-
Feb
-
Jan
-
-
2011
-
Dec
-
Nov
-
Oct
-
Sep
-
Aug
-
Jul
-
Jun
-
May
-
Apr
-
Mar
-
Feb
-
Jan
-
-
2010
-
Dec
- >
-
Nov
-
Oct
-
Sep
-
Aug
-
Jul
-
Jun
- > How to: get the node index of an element
- > Match elements via REGEXP in jQuery
- > GD barchart generator
- > Table sort - now REGEXP friendly
- > UI for Postcode Anywhere address look-up
- > Animated table sort
- > Ajaxify - re-route your forms via AJAX
- > curveMe - cross-browser curvy corners
- > Calculate time between two dates
-
May
-
Other stuff, er...
...I lead front-end development at London-based Espresso Education. More info...
...I'm part of the O'Reilly Blogger Review Scheme