我试图了解如何在“复制”按钮之前添加一个按钮,该按钮将始终是指向资源的create页面的链接。因此,如果是在/users上,在按钮列表中,如果用户单击Add,那么它将转到/ user /create。我将如何使用下面的代码来做到这一点。我也有几个错误,并研究了它,并发现我的错误可能是由于我的文件呈现顺序。我已经包括了下面的订单。我希望有人能帮我个忙。
TypeError: jQuery[g3g][((((Y2 + Z3) + G4) + p1) + F9e)] is undefined
...((Y2+G4+d6g+Z3+G4+A1e+U2+y8g))):jQuery&&!jQuery[g3g][(Y2+Z3+G4+p1+F9e)][(y8+t5e+...
dataTab...itor.js (line 475, col 170)
TypeError: DataTable.Editor is undefined
DataTable.Editor.defaults.display = "bootstrap";
editor....trap.js (line 8)
$('document').ready(function() {
$('#myDatatable').dataTable({
"pagingType": "full_numbers",
"aoColumnDefs": [
{ 'bSortable': false, 'aTargets': [-1] },
{ 'sWidth': '30px', 'aTargets': ['idTH'] },
{ 'sWidth': '150px', 'aTargets': ['actionsTH', 'subTH'] },
{ 'sClass': 'text-center', 'aTargets': ['idTH', 'actionsTH', 'subTH'] }
],
"iDisplayLength": 10,
"aLengthMenu": [
[5, 10, 25, 50, -1],
[5, 10, 25, 50, "All"]
],
dom: '<"dt-panelmenu clearfix"Tfr>t<"dt-panelfooter clearfix"ip>',
"oTableTools": {
"sSwfPath": "vendor/plugins/datatables/extensions/TableTools/swf/copy_csv_xls_pdf.swf"
}
});
});
<script src="http://myapp.app/vendor/jquery/jquery-1.11.1.min.js">
<script src="http://myapp.app/vendor/jquery/jquery_ui/jquery-ui.min.js">
<script src="http://myapp.app/assets/js/bootstrap/bootstrap.min.js">
<script src="http://myapp.app/assets/js/utility/utility.js">
<script src="http://myapp.app/assets/js/main.js">
<script type="text/javascript">
<script src="http://myapp.app/vendor/plugins/datatables/media/js/jquery.dataTables.js">
<script src="http://myapp.app/vendor/plugins/datatables/media/js/dataTables.bootstrap.js">
<script src="http://myapp.app/vendor/plugins/datatables/extensions/TableTools/js/dataTables.tableTools.min.js">
<script src="http://myapp.app/vendor/plugins/datatables/extensions/Editor/js/dataTables.editor.js">
<script src="http://myapp.app/vendor/plugins/datatables/media/js/dataTables.bootstrap.js">
<script src="http://myapp.app/vendor/plugins/datatables/extensions/Editor/js/editor.bootstrap.js">
<script src="http://myapp.app/assets/js/my-datatables.js">发布于 2015-03-02 17:47:16
首先,在您的<script>标记部分,您打开一个标记,但从不关闭它。这可能是你没有定义的奇怪的错误。与其说是剧本的位置,不如说是它们的顺序。
至于添加一个按钮到你的UI,有时数据解释的方式,它不会总是对你有利,更重要的是,因为这些按钮是基于闪光灯的。
为了举例,我想说的是:在你打电话给$('#myDatatable').dataTable({});之后
只需通过标准的jquery方法附加元素。
ie:
$('#myDatatable').append('<div style="width:100px;height:30px;background-color:#F60;color:#fff;position:absolute;top:2px;right:275px;">Hello</div>');同样,主要是为了举例,你可以根据需要进行调整,但你基本上可以把它紧贴在这些按钮的旁边,如果你想把它放在按钮容器里,但是你要处理额外的造型、定位等等。如果你对整个事物有一种感觉的话,那么最容易接近周围的地方。
https://stackoverflow.com/questions/28679534
复制相似问题