Sorting on class/id

Sorting on class/id

bjnebjne Posts: 3Questions: 0Answers: 0
edited January 2011 in General
I have values in a column that is translated to different languages, so not
very practical to write a filter for it.
Can I use a tag to write an integer value to sort upon in the td?

The values (and itengers to sort upon) is (in english)

0:undef
10:Low
20:Low to Medium
30:Medium-Low
40:Medium to Low
50:Medium
60:Medium to High
70:Medium-High
80:High
90:Very High
100:Variable

Replies

  • allanallan Posts: 63,516Questions: 1Answers: 10,472 Site admin
    Yes indeed you can use ID / class names to sort a column - for example: http://datatables.net/examples/plug-ins/dom_sort.html (using input elements, but trivial to change to ID / class). Or you can possibly use something like the hidden numeric sorting plug-in: http://datatables.net/plug-ins/sorting#hidden_title (which is probably slightly faster since you don't need to muck around reading the DOM, but isn't quite as flexible).

    Allan
This discussion has been closed.