我目前在页面中使用数据表.但是,当我尝试添加datatable编辑器插件时,我在控制台中收到错误:
TypeError: $.fn.dataTable.Editor is not a constructor
Run Code Online (Sandbox Code Playgroud)
我所做的只是在创建表的jquery中添加以下行:
var table = $('#sampledt').DataTable();
var editor = new $.fn.dataTable.Editor(table);
new $.fn.dataTable.Buttons( table, [
{
extend: "edit", editor: editor
},
{
extend: "remove", editor: editor
}
]);
table.buttons().container()
.appendTo( $('col-sm-6:eq(0)', table.table().container() ));
Run Code Online (Sandbox Code Playgroud)
这些是页面中的.js和.css:
jquery-1.12.0.min.js
bootstrap.min.js
jquery.dataTables.min.js
dataTables.bootstrap.min.js
dataTables.buttons.min.js
buttons.bootstrap.min.js
dataTables.select.min.js
dataTables.editor.min.js
bootstrap.min.css
dataTables.bootstrap.min.css
buttons.bootstrap.min.css
select.bootstrap.min.css
editor.bootstrap.min.css
Run Code Online (Sandbox Code Playgroud)
我错过了什么吗?提前致谢.
更新:
我添加了var editor = new $ .fn.dataTable.Editor(table); 删除了未定义"编辑器"的控制台错误.相反,发生了一个新错误:$ .fn.dataTable.Editor不是构造函数.
更新:
我从页面中删除了bootstrap.min.js.控制台错误"TypeError:a.Editor is undefined"已被删除.
我的数据库中有下表:

我想编写一个具有以下逻辑的 sql 查询:
IF QUIZZES<3, RETURN 'INCOMPLETE' ELSE 'COMPLETE'
Run Code Online (Sandbox Code Playgroud)
我如何制定我的查询?
谢谢