3
我已经按照datatables网站上显示的示例进行ajax请求,我无法让它与数据表nuget包一起工作。模型联编程序是疯狂的,因为搜索值为空,并期望它是一个空字符串。jquery datatables问题ajax datasource
控制器:
public JsonResult ListUsers([ModelBinder(typeof(DataTablesBinder))] IDataTablesRequest request)
查看:
<table id="users-table" class="table table-hover table-striped">
<thead>
<tr>
<th>#</th>
<th>First Name</th>
<th>Last Name</th>
</tr>
</thead>
</table>
$(function() {
$('#users-table').dataTable({
ajax: '@Url.Action("ListUsers", "Businesses",null,Request.Url.Scheme)'
});
});
搜索的值不能为空。如果没有执行搜索,请提供一个空字符串。 参数名:价值
你确定你期待的[正确的结构请求参数](http://datatables.net/manual/server-side#Sent-parameters),尤其是'search [value]'? –
我不期待任何事情,Nuget包和jquery库一起工作,不需要自定义代码。 –
如果您使用服务器端处理,则需要添加''serverSide':true' DataTables参数。 –