Disable sorting for a particular column in jQuery DataTables

前端 未结 23 1571
礼貌的吻别
礼貌的吻别 2020-11-30 19:58

I am using the jQuery DataTables plugin to sort the table fields. My question is: how do I disable sorting for a particular column? I have tried with the following code, but

23条回答
  •  失恋的感觉
    2020-11-30 20:28

    The code will look like this:

    $(".data-cash").each(function (index) {
      $(this).dataTable({
        "sDom": "<'row-fluid'<'span6'l><'span6'f>r>t<'row-fluid'<'span6'i><'span6'p>>",
        "sPaginationType": "bootstrap",
        "oLanguage": {
          "sLengthMenu": "_MENU_ records per page",
          "oPaginate": {
            "sPrevious": "Prev",
            "sNext": "Next"
          }
        },
        "bSort": false,
        "aaSorting": []
      });
    });
    

提交回复
热议问题