Buttons not working
Buttons not working
jcglazier
Posts: 7Questions: 2Answers: 0
All, I'm using Ajax & trying to add in buttons - I've tried a varied of methods, receiving no errors in the console, however my buttons are not appearing at all. I've inserted my logic, wondering if anybody could help. Thanks in advance.
Included .js & .css
<script type="text/javascript" src="js/jquery.js"></script>
<script src="js/table2csv.js"></script>
<script src="js/table2txt.js"></script>
<style><%@include file="/WEB-INF/views/jquery-ui.css"%></style>
<style><%@include file="/WEB-INF/views/datatables.css"%></style>
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
<script src="js/highcharts.js"></script>
<script src="js/exporting.js"></script>
<script src="js/table2csv.js"></script>
</head>
<body>
<jsp:include page="_header.jsp"></jsp:include>
<div id="scmainbody">
<h1 align="center">dummy</h1>
<script src="js/jqueryui.js"></script>
<script type="text/javascript" src="js/datatables.js"></script>
<script src="js/jquery-datatables-column-filter.js"></script>
<script src="js/fnSetFilteringDelay.js"></script>
<script src="js/fnStandingRedraw.js"></script>
<script src="js/dataTables.buttons.min.js"></script>
<script src="js/buttons.jqueryui.min.js"></script>
<script src="js/jszip.min.js"></script>
<script src="js/pdfmake.min.js"></script>
<script src="js/vfs_fonts.js"></script>
<script src="js/buttons.html5.min.js"></script>
<script src="js/buttons.print.min.js"></script>
<script src="js/buttons.colVis.min.js"></script>
javascript data tables below
<script>
var table;
jQuery(document).ready(function() {
table = $('#personTable').dataTable({
dom: 'Bfrtip',
buttons: [
{ text: 'Test' }
],
initComplete: function () {
var api = this.api();
console.log( api.buttons().container()[0].nodeName );
},
"bPaginate": true,
"order": [ 0, 'asc' ],
"bInfo": true,
"iDisplayStart":0,
"bProcessing" : true,
"bServerSide" : true,
"sAjaxSource" : "org/mlb/simplewebapp/servlet/JqueryDatatablePluginDemo.java",
"dom": 'C<"clear">lfrtip',
colVis: {
"align": "right",
restore: "Restore",
showAll: "Show all",
showNone: "Show none",
order: 'alpha',
"buttonText": "columns <img src=\"/datatableServersideExample/images/caaret.png\"/>"
},
"language": {
"infoFiltered": ""
},
"dom": 'Cf<"toolbar"">rtip',
})
.columnFilter({
aoColumns: [
{ type: "text"},
{ type: "text"},
{ type: "text"},
{ type: "text"},
{ type: "text"},
{ type: "text"},
],
bUseColVis: true
}).fnSetFilteringDelay();
$("#personTable_length").hide();
$("div.toolbar").append('<div class="btn-group" style="padding:5px "><button class="btn btn-default" id="refreshbtn" style="background:none;border:1px solid #ccc;height:30px" type="button"><span class="glyphicon glyphicon-refresh" style="padding:3px"></span></button></div>');
$("div.toolbar").css("float","right");
$('#refreshbtn').click(function(){
table.fnStandingRedraw();
});
});
This discussion has been closed.