Jquery 输入的DataTables分页插件不工作
我正在尝试使用DataTables的输入插件进行分页。我已经加载了所有三个jar文件——jQuery1.11.1、dataTables1.10和input.js。但我还是越来越Jquery 输入的DataTables分页插件不工作,jquery,datatables,datatables-1.10,Jquery,Datatables,Datatables 1.10,我正在尝试使用DataTables的输入插件进行分页。我已经加载了所有三个jar文件——jQuery1.11.1、dataTables1.10和input.js。但我还是越来越 TypeError: $.fn.dataTableExt is undefined 及 错误 我必须包括其他罐子吗?在一些旧帖子中,我看到plugin.jar被加载,但它本身并没有提到这个jar 数据表初始化代码 var table = $jq11('#openCasesTable').dataTable({
TypeError: $.fn.dataTableExt is undefined
及
错误
我必须包括其他罐子吗?在一些旧帖子中,我看到plugin.jar被加载,但它本身并没有提到这个jar
数据表初始化代码
var table = $jq11('#openCasesTable').dataTable({
"ajax": someUrl,
"aoColumnDefs": [
{ "bSortable": false, "aTargets": [0, 6, 7] }
],
"columns": [
{
"data": null,
"render": function(data, type, row, meta) {
...
}
},
...
],
"deferRender": true,
"dom": 'l<"#removeButtonDiv.removeButton">rtip',
"filter": false,
"initComplete": function(settings, json) {
$('#removeButtonDiv').html('<input id="removeButton" type="button" value="Remove" style="float:right; height: 25px;" disabled />');
},
"lengthMenu": [ [20, 40, 60, 80, 100], [20, 40, 60, 80, 100] ],
"language": {
"emptyTable": "No data to list",
"infoFiltered": " "
},
"order": [[4, "desc"]],
"processing": true,
"drawCallback": function( settings ) {
$.each(selected, function(index, value){
$('#'+value).attr("checked", "checked");
});
},
"serverSide": true,
"sPaginationType": "input"
});
var-table=$jq11(“#openCasesTable”).dataTable({
“ajax”:someUrl,
“aoColumnDefs”:[
{“bSortable”:false,“aTargets”:[0,6,7]}
],
“栏目”:[
{
“数据”:空,
“呈现”:函数(数据、类型、行、元){
...
}
},
...
],
“延迟渲染”:正确,
“dom”:“lrtip”,
“过滤器”:false,
“initComplete”:函数(设置,json){
$('#removeButtonDiv').html('');
},
“长度菜单”:[[20,40,60,80,100],[20,40,60,80,100],
“语言”:{
“emptyTable”:“没有要列出的数据”,
“信息过滤”:”
},
“订单”:[[4,“说明”],
“处理”:对,
“drawCallback”:函数(设置){
$.each(已选择,函数(索引,值){
$('#'+value).attr(“选中的”,“选中的”);
});
},
“服务器端”:正确,
“sPaginationType”:“输入”
});
从dataTable 1.10开始,他们改变了分页结构。现在他们使用了“分页”(布尔)、“分页类型”(字符串)属性,似乎他们也改变了分页插件的结构。因此,每个分页插件都不能在1.10上工作。您可以使用dataTable 1.9
新分页选项:
正在构建的分页插件页面:
它们提供完整、简单、完整和简单的数字作为默认选项。如果要使用输入分页,可以在中下载dataTable 1.9,或者尝试创建自己的向后兼容逻辑,如中提供的那样
HTML文件
<table id="example" class="display" cellspacing="0" width="100%">
<thead>
<tr>
<th>Name</th>
<th>Position</th>
<th>Office</th>
<th>Age</th>
<th>Start date</th>
<th>Salary</th>
</tr>
</thead>
<tfoot>
<tr>
<th>Name</th>
<th>Position</th>
<th>Office</th>
<th>Age</th>
<th>Start date</th>
<th>Salary</th>
</tr>
</tfoot>
<tbody>
<tr>
<td>Tiger Nixon</td>
<td>System Architect</td>
<td>Edinburgh</td>
<td>61</td>
<td>2011/04/25</td>
<td>$320,800</td>
</tr>
</tbody>
</table>
$(document).ready(function() {
$('#example').DataTable();
} );
包括下面的css以及格式
../../media/css/jquery.dataTables.css
所有的东西,样品和exmaple都在下面。你可以下载它
使用上述内容进行分页。如果您仍然面临问题,请从上面的链接添加文件,然后重试。您可以添加一个使用此插件的代码吗?正如@Eternal1所说,我们需要查看一些代码以了解您如何使用jQuery DataTables。您可以在此处查看如何使用jQuery DataTables的先决条件:添加了初始化代码。我看到您使用
$jq11
对象初始化dataTable
。您的页面上有几个jQuery
版本吗?@Eternal1-不,只有jQuery 1.11如果您能发布简洁的初始化代码,我将不胜感激。感谢您发布代码。但如果你明白我的意思,我希望有输入分页
<table id="example" class="display" cellspacing="0" width="100%">
<thead>
<tr>
<th>Name</th>
<th>Position</th>
<th>Office</th>
<th>Age</th>
<th>Start date</th>
<th>Salary</th>
</tr>
</thead>
<tfoot>
<tr>
<th>Name</th>
<th>Position</th>
<th>Office</th>
<th>Age</th>
<th>Start date</th>
<th>Salary</th>
</tr>
</tfoot>
<tbody>
<tr>
<td>Tiger Nixon</td>
<td>System Architect</td>
<td>Edinburgh</td>
<td>61</td>
<td>2011/04/25</td>
<td>$320,800</td>
</tr>
</tbody>
</table>
$(document).ready(function() {
$('#example').DataTable();
} );