New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
2个表导入同一个JSON报错的问题? #179
Comments
var dataTable1 = $('#dataTable1').DataTable( {
"ajax": 'js/data.json',
"columns": [
{ "data": "zlzs_xmmc" },
{ "data": "zlzs_jbjs" },
{ "data": "zlzs_zq" },
{ "data": "zlzs_mzlmj" },
{ "data": "zlzs_jzlmj" },
{ "data": "zlzs_qwzlmj" },
{ "data": "zlzs_qwzlmjbl" },
{ "data": "zlzs_zssl" },
{ "data": "zlzs_qwzssl" },
{ "data": "zlzs_qwzsbl" },
{ "data": "zlzs_gzsl" }
],
"sScrollX": "100%",
"fixedColumns": {
leftColumns: 2
}
});
var dataTable2 = $('#dataTable2').DataTable( {
"ajax": 'js/data.json',
"columns": [
{ "data": "hylt_xmmc" },
{ "data": "hylt_jbjs" },
{ "data": "hylt_hq" },
{ "data": "hylt_chgm" },
{ "data": "hylt_qwchdbs" },
{ "data": "hylt_qwchdbbl" },
{ "data": "hylt_yjjb" },
{ "data": "hylt_qwyjjbsl" },
{ "data": "hylt_qwyjjbbl" }
],
"sScrollX": "100%",
"fixedColumns": {
leftColumns: 2
}
}); |
@linguihe 你确定一个问题,不管你json数据是有几列,你columns里配置了,那么json里就一定要那个属性 |
没错~ 但是多循环了3次 |
@linguihe 多循环三次是什么意思?不太理解你这个意思,重新描述一下吧 |
就你给的data例子里面 数据不对 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
请问? 2个表 都是通过同一个json文件导入数据 但不同字段 比如说 A表10个字段 B表8个字段 但都在"data"{}对象中 如何避免报错?
The text was updated successfully, but these errors were encountered: