Javascript JQuery自定义列排序不适用于字母数字列

Javascript JQuery自定义列排序不适用于字母数字列,javascript,jquery,html,web,bootstrap-4,Javascript,Jquery,Html,Web,Bootstrap 4,我已经设置了用于数字或字母数据类型的自定义JQuery列排序,但无法用于字母数字。我会想象数字被排到顶部,字母被排到下面,但我无法让它做任何事情。Im使用引导数据表和JQuery。下面是我的自定义语句,但我看不出如何允许它们用于字母数字混合字段类型。有没有人能给我一个解决方案,或者告诉我在哪里可以找到?提前谢谢 /* Create an array with the values of all the input boxes in a column */ $.fn.dataTable.e

我已经设置了用于数字或字母数据类型的自定义JQuery列排序,但无法用于字母数字。我会想象数字被排到顶部,字母被排到下面,但我无法让它做任何事情。Im使用引导数据表和JQuery。下面是我的自定义语句,但我看不出如何允许它们用于字母数字混合字段类型。有没有人能给我一个解决方案,或者告诉我在哪里可以找到?提前谢谢

    /* Create an array with the values of all the input boxes in a column */
$.fn.dataTable.ext.order['dom-text'] = function(settings, col) {
    return this.api().column(col, { order: 'index' }).nodes().map(function(td, i) {
        return $('input', td).val();
    });
}

/* Create an array with the values of all the input boxes in a column, parsed as numbers */
$.fn.dataTable.ext.order['dom-text-numeric'] = function(settings, col) {
    return this.api().column(col, { order: 'index' }).nodes().map(function(td, i) {
        return $('input', td).val() * 1;
    });
}

/* Create an array with the values of all the select options in a column */
$.fn.dataTable.ext.order['dom-select'] = function(settings, col) {
    return this.api().column(col, { order: 'index' }).nodes().map(function(td, i) {
        return $('select', td).val();
    });
}

/* Create an array with the values of all the checkboxes in a column */
$.fn.dataTable.ext.order['dom-checkbox'] = function(settings, col) {
    return this.api().column(col, { order: 'index' }).nodes().map(function(td, i) {
        return $('input', td).prop('checked') ? '1' : '0';
    });
}

/* Initialise the table with the required column ordering data types */
$(document).ready(function() {
    $('#tab_logic').DataTable({
        "columns": [
            { "orderDataType": "dom-text-numeric" },
            { "orderDataType": "dom-text" },
            { "orderDataType": "dom-select" },
            { "orderDataType": "dom-select" },
            { "orderDataType": "dom-checkbox" }
        ]
    });
这解决了我的问题这解决了我的问题