PicNet/tablefilter — Issue #34: The autosort feature needs some
Author: pepebe
Created: 2011-12-24 00:33:32+00:00
State: open

The autosort feature is basically a good idea but It will cause unexpected side-effects national number systems.

Let me explain:

German numbers use a colon instead of a decimal point. So instead of 1.2 we write 1,2. For Javascript this is NaN and as a result he sort() function will treat the cell content as a simple string. The following example will explain the problem.

* 1,20
* 11,50
* 2,00

BUT, what I want to have is

* 1,20
* 2,00
* 11,50

In my case the problem was easily solved. The basic sort order in each column was already perfect, so there was no need to change it. As a quick (and dirty) fix I removed $values$$7$$.sort(); from your code

As a long term solution I could imagine to use sort="false" in a th element to switch-off sorting for this particular column. This could also easily be extended to offer sort="asc" or sort="desc".

Regards,

pepebe

BTW. Thanks for sharing your code with us!