How to sort by Date with DataTables jquery plugin?

后端 未结 13 2609
隐瞒了意图╮
隐瞒了意图╮ 2020-12-02 11:02

I am using the datatables jquery plugin and want to sorty by dates.

I know they got a plugin but I can\'t find where to actually download it from

http://data

13条回答
  •  温柔的废话
    2020-12-02 11:39

    Create a hidden column "dateOrder" (for example) with the date as string with the format "yyyyMMddHHmmss" and use the property "orderData" to point to that column.

    var myTable = $("#myTable").dataTable({
     columns: [
          { data: "id" },
          { data: "date", "orderData": 4 },
          { data: "name" },
          { data: "total" },
          { data: "dateOrder", visible: false }
     ] });
    

提交回复
热议问题