DataTables提示:DataTables warning: table id=queueInfo_table - Requested unknown parameter 'type' for r
生活随笔
收集整理的这篇文章主要介绍了
DataTables提示:DataTables warning: table id=queueInfo_table - Requested unknown parameter 'type' for r
小编觉得挺不错的,现在分享给大家,帮大家做个参考.
场景
如图:
实现
依据提示可知第一行第五列的type参数为空或不存在。
其官方解释为:
https://datatables.net/manual/tech-notes/4
所以找到这个表的type属性赋值的代码。
columns: [{data: 'id'},{data: 'code'},{data: 'orderCode'},{data: 'destination'},{data: 'type',render: function (data) {if (data == 0) {return 'MES自动';}}},可见赋值的部分,逻辑判断不全,这里数据是1,但是却没有对应的值,应该添加相应的应对措施。
修改为:
columns: [{data: 'id'},{data: 'code'},{data: 'orderCode'},{data: 'destination'},{data: 'type',render: function (data) {if (data == 1) {return '自动';}else if(data == 2){return '手动';}else{return '未知状态';}}},
总结
以上是生活随笔为你收集整理的DataTables提示:DataTables warning: table id=queueInfo_table - Requested unknown parameter 'type' for r的全部内容,希望文章能够帮你解决所遇到的问题。
- 上一篇: textarea怎样隐藏滚动条
- 下一篇: Pytyon3中实现十进制转不同进制