我有一个6列的表格。第一个和最后一个是日期,其余数字是日期。
我想做的是最初(按标准)按日期对表格进行排序,同时为用户提供按数字进行排序的可能性。

问题是,当我仅使用ordering = true时,日期不遵循正确的顺序,因此我必须使用columnDefs:[{“ targets”:[0,5],“ type”:“ date-eu”}。
但是,当我这样做时,排序选项在其他列中不再起作用。
然后我尝试添加以下内容:columnDefs:[{“ targets”:[0,5],“ type”:“ date-eu”},{“ targets”:[1,2,3,4],orderable:true }],但仍然没有。

你知道我该怎么解决吗?

var table = $('#tbl_compare').DataTable( {
    searching: false,
    lengthChange: false,
    info:false,
    processing: false,
    columnDefs : [{"targets":[0,5], "type":"date-eu"}, {"targets": [1,2,3,4],orderable:true}],
    order: true,
    iDisplayLength: 10,
    }

最佳答案

我相信我找到了解决方案
顺序:[];

07-24 17:27
查看更多