Model binding new Datatables 1.10 parameters

前端 未结 6 1466
南方客
南方客 2021-02-01 16:44

In Datatables 1.10 the ajax server side parameters changed from

public class DataTableParamModel
{ 
    public string sEcho{ get; set; }
    public string sSearc         


        
6条回答
  •  长情又很酷
    2021-02-01 17:41

    I changed my javascript to use the legacy ajax params option which uses the old parameters to send to the server. This is done through $.fn.dataTable.ext.legacy.ajax = true; so now my code becomes something like...

    $.fn.dataTable.ext.legacy.ajax = true;
    var datatable = $('#data-table').DataTable({
        "processing": true,
        "serverSide": true,
        "ajax": "MyController/AjaxHandlerPaging",
        "pageLength": 25,
        "order": [[2, 'desc']],
        "columns": []
    });
    

提交回复
热议问题