diff --git a/pykat/testing/web/templates/finesse_kat_history.html b/pykat/testing/web/templates/finesse_kat_history.html index cae7c676b9b04a51c837620041a887ccb4759318..5a59b617be3f844f34c5c3732650dfb184b79f69 100644 --- a/pykat/testing/web/templates/finesse_kat_history.html +++ b/pykat/testing/web/templates/finesse_kat_history.html @@ -34,9 +34,31 @@ <script type="text/JavaScript"> $(document).ready(function(){ + jQuery.extend( jQuery.fn.dataTableExt.oSort, { + "num-html-pre": function ( a ) { + var x = String(a).replace( /<[\s\S]*?>/g, "" ); + return parseFloat( x ); + }, + + "num-html-asc": function ( a, b ) { + return ((a < b) ? -1 : ((a > b) ? 1 : 0)); + }, + + "num-html-desc": function ( a, b ) { + return ((a < b) ? 1 : ((a > b) ? -1 : 0)); + } + } ); - gtable = $('#tblHistory').dataTable(); - + gtable = $('#tblHistory').dataTable({ + "iDisplayLength":250, + "aoColumns": [ + { "sType": "num-html" }, + null, + { "sType": "date" }, + { "sType": "numeric" }, + { "sType": "numeric" } + ] + } ); }); </script> diff --git a/pykat/testing/web/templates/finesse_test_view.html b/pykat/testing/web/templates/finesse_test_view.html index ba69fd92466e7ae67ecaed9abdbe40c4dd97612e..4330ba9f9ebe27461ba27a539862f921b3425201 100644 --- a/pykat/testing/web/templates/finesse_test_view.html +++ b/pykat/testing/web/templates/finesse_test_view.html @@ -52,9 +52,40 @@ <script type="text/javascript" charset="utf8" src="http://ajax.aspnetcdn.com/ajax/jquery.dataTables/1.9.4/jquery.dataTables.min.js"></script> <script type="text/JavaScript"> + + $(document).ready(function(){ - - gtable = $('#tblResults').dataTable(); + jQuery.extend( jQuery.fn.dataTableExt.oSort, { + "num-html-pre": function ( a ) { + console.log("1"); + var x = String(a).replace( /<[\s\S]*?>/g, "" ); + return parseFloat( x ); + }, + + "num-html-asc": function ( a, b ) { + console.log("2"); + return ((a < b) ? -1 : ((a > b) ? 1 : 0)); + }, + + "num-html-desc": function ( a, b ) { + console.log("3"); + return ((a < b) ? 1 : ((a > b) ? -1 : 0)); + } + } ); + gtable = $('#tblResults').dataTable({ + "iDisplayLength":250, + "aLengthMenu": [[-1], ['All']], + "aoColumns": [ + null, + null, + { "sType": "numeric" }, + {"bSearchable": false, "bSortable": false}, + {"bSearchable": false, "bSortable": false}, + {"bSearchable": false, "bSortable": false}, + {"bSearchable": false, "bSortable": false}, + {"bSearchable": false, "bSortable": false} + ] + } ); });