title: How to use different data for sorting
body: <p>I'm using jQuery DataTables 1.10.4 to render a table each of whose rows has bits of information about a file. </p>
  
  <p>A column in this table shows file sizes. When rendered, I want the column to read <code>NNN KB</code> (with a "KB" suffix). I also want the user to be able to numeric sort on the file size column. </p>
  
  <p>However, while my <code>files</code> data array just has numbers indicating the size of the file in bytes, the sort functionality seems to use the rendered value of the string, and I get a string sort, not a numeric one. </p>
  
  <p>Is there an easy way to declare the type of the column such that the sort is numeric? I.e. for sorting, I'd like jQuery DataTables to use the values in the files array.</p>
  
  <p>If this can't just be declared with a <code>columnDefs</code> specification, what is the easiest sort plugin or function to use?</p>
  
  <p>Here's what I have so far.</p>
  
  <pre><code>var files = {['name','dir',10240], .... }
  
  var sortable_size = function(data, type, full, meta) {
      return Math.floor(full[2]/1024) + " KB";
  };
  
  $('#files').dataTable({
     data: files,
     pagingType: 'simple',
     columnDefs: [
        { targets:0, render:clickable_message },
        { targets:3, render:clickable_attachment },
        { targets:2, render:sortable_size, width:'100px', type:'num' }
     ], 
     // no width for col 0 here because it causes linewrap in data 
     // and size fields (attachment name can be fairly wide as well)
     order:[[1, 'asc']], // col 1 (date), ascending
     fnInitComplete: function() { 
        $('#attachments').fadeIn(); 
     }
  });
  </code></pre>