title: DataTables: sort by numeric data-order not working?
body: <p>I am using DataTables version 1.10. I want to make a column sortable by a numeric value, when the value shown in the column is not numeric.</p>
  
  <p>I can see that <a href="http://datatables.net/examples/advanced_init/html5-data-attributes.html" rel="nofollow">what I need to do is add a <code>data-sort</code> attribute</a> to each table cell. I've tried adding this with the <code>createdRow</code> method, but although I can see the attribute in the HTML, it's not sorting numerically. </p>
  
  <p>This is my code:</p>
  
  <pre><code>var data = [
        {
            'name': 'France',
            'played': 1000,
            'won': 11
        },
        {
            'name': 'England',
            'played': 1000,
            'won': 100
        },
        {
            'name': 'Germany',
            'played': 1000,
            'won': 109
        }
    ];
      $.each(data, function(i, d) {
          d.won_percent = (d.won / d.played) * 100;
          d.won_display = d.won + '/' + d.played;
          d.won_display += ' (';
          d.won_display += Math.round(d.won_percent * 10) / 10;
          d.won_display += '%)';
      });
    var columns = [
      { "data": "name",
        "title": "Country"
      },
      { "data": "won_display",
        "title": "Games won"
      },
      { "data": null,
        "title": "Notes",
       "defaultContent": 'Some other text here, included just to test that responsive works'
      }  
    ];
    var html = '&lt;table class="table table-bordered table-hover" cellspacing="0" width="100%" id="myTable"&gt;&lt;/table&gt;';
    $('#table').html(html);
    $("#myTable").DataTable({
      data: data,
      columns: columns,
      order:[[1, "desc"]],
      responsive: true,
      paging: false,
      searching: false,
      createdRow: function (row, data, rowIndex) {
        $.each($('td', row), function (colIndex) {
          if (colIndex === 1) {
            $(this).attr('data-order', data.won_percent);
          }
        });
      }
    });
  });
  </code></pre>
  
  <p>How can I get my table to sort by the value of <code>d.won_percent</code>?</p>
  
  <p>Note that I'm also building a responsive table, which means that I need to be careful about using render events. </p>
  
  <p>JSFiddle here: <a href="http://jsfiddle.net/07nk5wob/5/" rel="nofollow">http://jsfiddle.net/07nk5wob/5/</a></p>