title: jquery datatables: sort type numeric not working
body: <p>I have a datatable with about 20 columns. I have a Serial Number column that consists of completely numeric values and is defined as int in the database. I have spent so much time trying to figure out why this is not working but still no clue. I tried using sType='numeric' , type='num', num-html,num-fmt .. nothing seems to work. I either get sorting like the following :</p>
  
  <pre><code>1
  1
  10
  100
  </code></pre>
  
  <p>or it doesn't sort at all. I checked my data and it does not have null or any non-numeric values. Database has completely integer values and I am completely stumped as to why suddenly this is not working. Please help. This is my code. </p>
  
  <pre><code>&lt;table id="myTable"&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Col1&lt;/th&gt;
              &lt;th&gt;Col2&lt;/th&gt;
              &lt;th&gt;Col3&lt;/th&gt;
              &lt;th&gt;Col4&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          @foreach (var item in Model)
          {
              &lt;tr&gt;
                  &lt;td title="Del"&gt;
                      Data1
                  &lt;/td&gt;
                  &lt;td&gt;
                      &lt;div&gt;
                          &lt;div class="dropdown-menu" aria-labelledby="dropdownMenuLink"&gt;
                              @Html.ActionLink("Edit", "Edit", new { id = item.Id })
                              @Html.ActionLink("Details", "Details")
                              @Html.ActionLink("Delete", "Delete")
                          &lt;/div&gt;
                      &lt;/div&gt;
                  &lt;/td&gt;
                  &lt;td&gt;
                      Data2
                  &lt;/td&gt;
                  &lt;td&gt;
                      &amp;nbsp;@Html.DisplayFor(modelItem =&gt; item.Serial)
                  &lt;/td&gt;
              &lt;/tr&gt;
          }
  &lt;/table&gt;
  </code></pre>
  
  <p>The following is from my Layout.cshtml: </p>
  
  <pre><code>var table = $('#myTable').DataTable({
                      "lengthMenu": [[100, 200, 300, 500, -1], [100, 200, 300, 500, "All"]],
                      fixedHeader: true,
                      // "bFilter": false, to turn off search
                      fixedColumns: {
                          heightMatch: 'none'
                      },
                      colReorder: true,
                      stateSave: true,
                      "aoColumnDefs": [
                          { "sType": "numeric", "aTargets": [3] },
                          { "bSortable": false, "aTargets": [0] },
                          { "bSearchable": false, "aTargets": [0] }
                      ]
                  });
  </code></pre>