I am using Server Side pagination But my Sorting ,Searching and File exporting is not working ?
I am using Server Side pagination But my Sorting ,Searching and File exporting is not working ?
Hi All,
My code .
$(document).ready(function() {
function renderTable() {
var table = new $.fn.dataTable.Api('#captureDataTable');
dom : 'BTftlpi',
buttons : [ {
extend : 'copyHtml5',
//footer : true,
exportOptions : {
columns : [ 19, 2, 3, 4, 5, 6, 7, 8, 9 ]
}
}, {
extend : 'csvHtml5',
title : 'Capture Transactions',
//footer : true,
exportOptions : {
columns : [ 19, 2, 3, 4, 5, 6, 7, 8, 9 ]
}
}
} ],
"ajax" : {
"url" : "captureTransactionAction",
"type" : "POST",
data : function (d){
return generatePostData(d);
}},
"processing": true,
"serverSide": true,
"paginationType": "full_numbers",
"lengthMenu": [[10, 25, 50, -1], [10, 25, 50, "All"]],
"order" : [ [ 1, "desc" ] ],
"columns" : [ {
"data" : "transactionId",
"width" : '9%',
"className" : "my_class"
},
{
"data" : "txnDate",
"width" : '10%'
},
{
"data" : "orderId",
"width" : '10%'
}] });
}
function generatePostData(a) {
var token = document.getElementsByName("token")[0].value;
var obj = {
acquirer : document.getElementById("acquirer").value,
dateFrom : document.getElementById("dateFrom").value,
dateTo : document.getElementById("dateTo").value,
paymentType : document.getElementById("paymentMethods").value,
payId : document.getElementById("merchant").value,
currency : document.getElementById("currency").value,
draw : a.draw,
length : a.length,
start : a.start,
token : token,
"struts.token.name" : "token",
}
return obj;
}
Answers
Thanks for your question - however, per the forum rules can you link to a test case showing the issue please. This will allow the issue to be debugged.
Information on how to create a test page, if you can't provide a link to your own page can be found here.
Thanks,
Allan