Hey everybody! I am running into an issue where i can't seem to be able to format numbers that have HTML strings along with them. There was a similar thread that talked about HTML strings, links in particular, breaking sorting on DataTables and writing custom sorting in order to handle that. I used that thread so I can sort my data but I also want to be able to format the data. I was going off of another thread talking about how DataTables has the fnFormatNumber method and I tried to use that to sort the data. It works for all data that does not have HTML links in the table. I was wondering if anyone had any ideas on how I could both be able to sort the data, format the data, and all without breaking the links. Here are the threads that I talked about in this post:
http://datatables.net/forums/discussion/367/bug-sort-number-column-and-stype/p1
http://www.datatables.net/forums/discussion/2620/format-numbers/p1
And here is the relevant dataTables code for the table that I am working on.
If this was confusing I would be happy to try and clear it up and I would really appreciate an answer on this.
Thank You!
http://datatables.net/forums/discussion/367/bug-sort-number-column-and-stype/p1
http://www.datatables.net/forums/discussion/2620/format-numbers/p1
And here is the relevant dataTables code for the table that I am working on.
$('#archive_table').dataTable({ "aoColumns": [ null, null, { "sType": "num-html" }, null, null, null ], "bFilter" : false, "bInfo" : false, "bLengthChange" : false, "bPaginate" : false, "bSort" : true, "aaSorting": [[ 6, "desc" ]], "aoColumnDefs": [ { "bSearchable": false, "bVisible": false, "aTargets": [ 6 ] }, { "aTargets": [ 3, 4, 5 ], "bUseRendered": false, "fnRender": function ( o ) { return o.oSettings.fnFormatNumber( parseFloat( o.aData[ o.iDataColumn ] ) ); } } ] });
If this was confusing I would be happy to try and clear it up and I would really appreciate an answer on this.
Thank You!