...

View Full Version : Jquery custom address parser for tablesorter



ElMartino
02-28-2011, 10:03 AM
Hello,



I'm using the jquery.tablesorter to sort my tables. You can make custom parsers for the plugin, which is also great!



Now i'm facing a little problem: I want to sort by streetname and streetnumber.



This would be easy if the streetnumber only contained numbers, but they can also contain characters. For example:



Lindelaan 8a

Lindelaan 8b

Lindelaan 8c

Lindelaan 18

Lindelaan 32

Lindelaan 86



I can create a custom parser like this:




$.tablesorter.addParser({
id: 'address',
is: function(s) {
return false;
},
format: function(s) {

var address = s.split('/');
var srt = String(address[0]);
return '' + srt;
},
type: 'numeric'
});




Can anybody help me with this?



Thanks in advance!



ElMartino



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum