无法排列列 [英] Unbable to sort the columns

查看:159
本文介绍了无法排列列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用jQuery DataTables。

I am using jQuery DataTables.

searchResultsTable = $("#searchResultsTable").dataTable({
    "bServerSide": true,
    "sAjaxSource": "searchResults.form",
    "bProcessing": false,       
    "sPaginationType": "full_numbers",
    "oLanguage": {"sEmptyTable": "No data available", "sLengthMenu" :" _MENU_ items per page",
    "sInfo": "Showing _START_ to _END_ of _TOTAL_ records",
    "sInfoEmpty": "No entries to show"},
    "sDom": 'tlip',
    "aaSorting": [],
    "aoColumns": [null,null,null,null,{ "bVisible": false }]
});

我已经提供了 aaSorting ,以便当用户点击标题时,数据将被排序。但它不工作我错过了什么吗?

I have provided the aaSorting, so that the data gets sorted when user clicks on the header. But it's not working. Am I missing something?

推荐答案


原因

您的服务器端处理模式已启用bServerSide:true 。在这种模式下,应该在服务器上执行包括排序,过滤和排序的数据处理,返回的数据需要具有某些结构。有关详细信息,请参见处理模式

You have server-side processing mode enabled with "bServerSide": true. In this mode, data processing including sorting, filtering and ordering should be performed on the server and the returned data need to have certain structure. See Processing modes for more information.


解决方案

如果您不执行数据处理服务器,只需删除bServerSide:true ,DataTables将在客户端执行排序,过滤和排序。

If you are not performing data processing on the server, simply remove "bServerSide": true and DataTables will perform sorting, filtering and ordering on the client-side.

这篇关于无法排列列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆