Not case-sensitive ordering

Not case-sensitive ordering

deiandeian Posts: 4Questions: 0Answers: 0
edited September 2010 in General
Hello,

by default DataTables 1.7.2 order by data thisway:
A
B
C
a
b
c

Is it possible to order it
A
a
B
b
C
c

Thank you

Replies

  • deiandeian Posts: 4Questions: 0Answers: 0
    Hello,

    I'm sorry, but I still didn't figure that out.
    Does someone knows if human ordering is possible?

    Thank you
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    DataTables does this by default when using client-side processing. This can be confirmed by just changing one of the default examples where it says 'Gecko' to 'gecko'. DataTables will do a tolowercase() on all strings which are sorted, before sorting them, to make it case insensitive.

    You might be using server-side processing(?), in which case the answer will be down to however your database does case insensitive sorting.

    Allan
  • deiandeian Posts: 4Questions: 0Answers: 0
    edited September 2010
    Allan,

    thanks for your answer.
    I didn't realized that this comes from the database.

    So, to be precise:
    If someone is using this example:
    http://www.datatables.net/development/server-side/php_mysql

    and If you are using utf8_bin collation
    to have case insensitive ordering you should change row 66 to:
    [code]$sOrder .= "LOWER (".$aColumns[ intval( $_GET['iSortCol_'.$i] ) ].")[/code]
This discussion has been closed.