Datables wrning(table id='example'):Cannot reinitialise DataTable.
出现的问题如下所示:
Datables wrning(table id='example'):Cannot reinitialise DataTable. To retrieve the Datables object for this table,please pass eithser no arguments to the dataTable() function,
我查阅了网上的教程。
给出两种解决方式:
加 "bDestroy":true,和"bRetrieve": true, 只是能屏蔽提示。
加一fnDestroy();在代码中:
$('#example').dataTable().fnDestroy();
给一段我写的跳json的代码:
//加载审核信息
function jzxw(){
$.ajax( {
type : 'POST',
dataType : 'json', // json对象
url : 'order1!show1.action',
data : null,
success : function(response, status, xhr) {
var s = "";
s +='<thead><tr><td width="7%"><input type="checkbox" id="select" /><label><b>全选</b></label> </td><td><center><b>订单号</b></center></td><td ><center><b>申请退款的时间</b></center></td><td ><center><b>退款金额</b></center></td><td ><b><center>状态</b></center></td><td ><center><b>操作</b></center></td></tr></thead>';
s +='<tbody>';
$.each(response,function(index, value) {
// 组合
s+='<tr><td><input type="checkbox" name="ckb" value="'+value[0]+'">'
s += '</td><td><center>' + value[1];
s += '</center></td><td><center>' + value[2]
+ '</center></td><td><center>' + value[3]
+ '</center></td><td><center>' + value[4]
+'</center></td><td><center>'
s += '<a class="btn btn-info" onclick="scxw('+value[0]+')">通过审核</a>';
s += '</center></td></tr>';
})
s +='</tbody>';
$("#table_id").html(s);
$("#table_id").dataTable({
"bDestroy":true, "oLanguage": {
"sProcessing": "正在加载中......",
"sLengthMenu": "每页显示 _MENU_ 条记录",
"sZeroRecords": "对不起,查询不到相关数据!",
"sEmptyTable": "表中无数据存在!",
"sInfo": "当前显示 _START_ 到 _END_ 条,共 _TOTAL_ 条记录",
"sInfoFiltered": "数据表中共为 _MAX_ 条记录",
"sSearch": "搜索",
"oPaginate": {
"sFirst": "首页",
"sPrevious": "上一页",
"sNext": "下一页",
"sLast": "末页"
}
} //多语言配置 }); ckb();
},
error : function() {
alert("加载失败");
} }) }
这样子就不会出现错误的提示信息了
Datables wrning(table id='example'):Cannot reinitialise DataTable.的更多相关文章
- laravel框架中报错 DataTables warning: table id=xxx-table - Cannot reinitialise DataTable.
laravel框架中报错 DataTables warning: table id=xxx-table - Cannot reinitialise DataTable. 分析: initializin ...
- Vue+DataTables warning:table id=xxxx -Cannot reinitialize DataTable.报错解决方法
问题描述: 使用DataTables来写列表,用vue来渲染数据,有搜索功能,每次点击搜索就会报错,如下图所示. 问题排查: 找了一系列原因,最后发现是我每次请求完数据之后都会添加分页功能,从而导致了 ...
- DataTables warning: table id=data-table - Requested unknown parameter '3' for row 0.
本文为博主原创,未经允许,不得转载: 在使用jquery 的datatable时,报错在页面弹出弹出框,并提示以下内容: DataTables warning: table id=data-table ...
- DataTables warning: table id=dataTable - Requested unknown parameter 'acceptId' for row 0. For more
重点内容 DataTables warning: table id=dataTable - Requested unknown parameter 'acceptId' for row 0. For ...
- DataTables warning (table id = 'myTable'): Requested unknown parameter '0' from the data source for row 0
第一种方式:不用在js里设置列Html: <table id="myTable"> <thead> <tr> <th>Title-1 ...
- Cannot reinitialise DataTable 问题
加个 destroy:true, //Cannot reinitialise DataTable,解决重新加载表格内容问题
- dataTables去掉搜索框和每页多少条框体,解决Cannot reinitialise DataTable问题
$('#example').DataTable({ searching:false, //去掉搜索框 bLengthChange:false,//去掉每页多少条框体 "language&qu ...
- datatables插件提示Cannot reinitialise DataTable的解决办法
这个错误是由于重新设置数据源,又没有将原来的数据清空导致的. 网上有很多解决方案,试了都不管用. 最后找到一种方法,将原来的table销毁,再初始化. 方法是在datatable初始化的时候加入属性 ...
- jQuery DataTables 问题:Cannot reinitialise DataTable
解决: destroy: true, var tabel = $('#userlist').DataTable({ destroy: true, ...
随机推荐
- winform窗体——布局方式
一.默认布局 ★可以加panel,也可以不加: ★通过鼠标拖动控件的方式,根据自己的想法布局.拖动控件的过程中,会有对齐的线,方便操作: ★也可选中要布局的控件,在工具栏中有对齐工具可供选择,也有调整 ...
- [BZOJ 2350] [Poi2011] Party 【Special】
题目链接: BZOJ - 2350 题目分析 因为存在一个 2/3 n 大小的团,所以不在这个团中的点最多 1/3 n 个. 牺牲一些团内的点,每次让一个团内的点与一个不在团内的点抵消删除,最多牺牲 ...
- Android Wear开发 - 数据通讯 - 第二节 : 数据的发送与接收
本节由介绍3种数据的发送接收:1.Data Items : 比特类型数据,限制100KB以内2.Assets : 资源类型数据,大小无上限3.Message : 发送消息,触发指令 http://de ...
- 【HDOJ】3088 WORM
状态压缩+BFS. /* 3088 */ #include <iostream> #include <cstdio> #include <cstring> #inc ...
- Channel Allocation(四色定理 dfs)
Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 10897 Accepted: 5594 Description When ...
- 线段树(维护最大值):HDU Billboard
Billboard Time Limit: 20000/8000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total ...
- 网络流(最大流):POJ 1149 PIGS
PIGS Time Limit: 1000ms Memory Limit: 10000KB This problem will be judged on PKU. 64-bit integer(整数) ...
- [PHP] PHP Excel导出 以及编码问题
PHP导出Excel 很简单 在一开头输入 下面就可以是Table,html或者PHP echo出来的都行 <? php header("Content-type:applicatio ...
- Remove Duplicates from Sorted List II ——LeetCode
Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numb ...
- 数据结构典型算法的VC实现(袁辉勇)
1. 迷宫问题求解 #include <stdio.h> #define m 8 //迷宫内有8列 #define n 8 //迷宫内有8行 #define MAXSIZE 100//栈尺 ...