Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to sort on a numeric column in jQuery DataTables
    primarykey
    data
    text
    <p>(Looked at a bunch of answers on this topic, none of which applies to this question.)</p> <p>The DataTables have the feature of letting the user click on each column's Up/Down triangle icons to sort in Ascending or Descending order. I have loaded the data as follows</p> <pre><code> oTable.fnAddData( ["Bogus data","1,541,512","12.5%","0","0","0"]); oTable.fnAddData( ["Bogus data","3,541,512","2.5%","0","0","0"]); oTable.fnAddData( ["Bogus data","541,512","1.5%","0","0","0"]); oTable.fnAddData( ["Bogus data","2,541,512","32.5%","0","0","0"]); oTable.fnAddData( ["Bogus data","741,512","3.5%","0","0","0"]); oTable.fnAddData( ["A Bogus data","41,512","1.5%","0","0","0"]); oTable.fnAddData( ["Bogus data","2,541,512","12.5%","0","0","0"]); oTable.fnAddData( ["Z Bogus data","1,541,512","12.5%","0","0","0"]); oTable.fnAddData( ["Bogus data","3,541,512","2.5%","0","0","0"]); oTable.fnAddData( ["La Bogus data","541,512","1.5%","0","0","0"]); oTable.fnAddData( ["The Bogus data","2,541,512","32.5%","0","0","0"]); oTable.fnAddData( ["Bogus data","741,512","3.5%","0","0","0"]); oTable.fnAddData( ["Bogus data","41,512","1.5%","0","0","0"]); oTable.fnAddData( ["Bogus data","2,541,512","12.5%","0","0","0"]); oTable.fnAddData( ["Bogus data","1,541,512","12.5%","0","0","0"]); oTable.fnAddData( ["Bogus data","3,541,512","2.5%","0","0","0"]); oTable.fnAddData( ["Bogus data","541,512","1.5%","0","0","0"]); oTable.fnAddData( ["Bogus data","2,541,512","32.5%","0","0","0"]); oTable.fnAddData( ["Bogus data","741,512","3.5%","0","0","0"]); oTable.fnAddData( ["Bogus data","41,512","1.5%","0","0","0"]); </code></pre> <p>In column number 2 the numeric values are processed alphabetically when I click on the Up/Down triangles. How can I adjust it so that the second column Up/Down arrows will trigger the proper way, treating the characters as numbers. I tried using the following initialization:</p> <pre><code>oTable = $('.utable').dataTable( { "aoColumns": [{ sWidth: '60%' },{sWidth: '30%', "sType": "numeric"},{ sWidth: '10%' }], "sDom": 'rt', "sScrollY":"200px", "bPaginate":false, "bFilter":false, "bInfo": false}); </code></pre> <p>All this does is to lock the colum and the Up/Down icons will not work in the header of that column. </p> <p>Please help</p> <p>DKean</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload