javascript - Tablesorter and automatic sorter digit? -



javascript - Tablesorter and automatic sorter digit? -

i have lot of table using tablesorter on website , i'm looking way sort "sorter: 'digit' column have specific classname : "class="note".

i know of header :

$(".tablesorter").tablesorter({ headers: { 0: { sorter: 'digit' } // column number, type } });

but there generic way html :

<th class="{sorter: 'digit'}">note</th>

or classname <th class="note">note</th> somewhere in javascript this

$(".tablesorter .note").tablesorter() ...

?

because column "note" sometime 3rd column, sometime 5th etc.

i inquire because without "digit" order specified, tablesorter not know how sort numbers ... here united nations jsfiddle show mean : http://jsfiddle.net/2cmuy39l/

thank you.

if using fork of tablesorter, can accomplish @ to the lowest degree 2 different ways:

add sorter-digit class name headers

<th class="note sorter-digit">note</th>

use class name in headers option (added in v2.17.0) - here demo:

headers : { '.note' : { sorter: 'digit' } }

javascript tablesorter

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -