The first row of jquery datatable custom sort has no effect

jquery datatable custom sort the first row has no effect, the data is float, like 11.1 22.2 33.3, using the extension method, but after using it, except for the abnormal sorting of the first row, everything else is sorted normally, which is strange

.

$(document) .ready (function () {

    jQuery.extend(jQuery.fn.dataTableExt.oSort, {
        "float": function ( a ) {
            return parseFloat( a );
        },
        "float-asc": function ( a, b ) {
            return a - b;
        },
        "float-desc": function ( a, b ) {
            return b - a;
        }
    } );
    $("-sharptable").DataTable({
        searching: false,
        "aoColumnDefs": [
            { "sType": "float", "aTargets": [ 3 ] }
        ],
        order: [],
        "language": {
            "url": "//cdn.datatables.net/plug-ins/1.10.19/i18n/Chinese.json"
        }
    });
    
    
   js  
Apr.06,2021

solved, it is


caused by the different length of each line in table. Can you explain in more detail

?
Menu