【发布时间】:2015-11-14 07:47:02
【问题描述】:
我正在使用 Ruby on Rails 和 DataTables (jquery-datatables-rails 3.3.0)
它工作正常,但我无法在我的表格中添加按钮和工具栏:
<table class='table table-striped table-condensed table-bordered display' id="tasks">
<thead>
<tr>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>2</td>
</tr>
</tbody>
</table>
在我的 .coffee 文件中:
jQuery ->
$('#tasks').dataTable
bJQueryUI: true
dom: "Bfrtip"
buttons: ["create"]
scrollX: true
paging: false
ordering: false
但是我的桌子上没有创建按钮。其他功能,如:scrollX:真正的工作正常
谁能帮帮我?
我的 application.js:
//= require jquery
//= require jquery_ujs
//= require dataTables/jquery.dataTables
//= require dataTables/extras/dataTables.responsive
//= require dataTables/jquery.dataTables.foundation
//= require dataTables/extras/dataTables.tableTools
//= require dataTables/bootstrap/3/jquery.dataTables.bootstrap
//= require bootstrap
//= require turbolinks
//= require_tree .
我的 application.css.scss:
*= require_tree .
*= require_self
*= require dataTables/jquery.dataTables
*= require dataTables/jquery.dataTables.foundation
*= require dataTables/bootstrap/3/jquery.dataTables.bootstrap
*= require dataTables/extras/dataTables.responsive
*= require dataTables/extras/dataTables.tableTools
*/
【问题讨论】: