I have a web application in which I am using DataTable version 1.10 to display the records and for pagination. I am new to DataTable. I am finding it difficult in capturing the parameters like search string in the search box of data table, Sort action,iTotalRecords,iTotalDisplayRecords,iDisplayLength etc etc.,
I am using struts2 for my web application. I have enabled the bServerSide=true;
and calling "sAjaxSource" : "PaginationAction"
. the records private List<Income> aaData;
are getting populated in jsp page. But I am finding it difficult to capture the other parameters as specified above. to which action class's variable does this entered string goes to.? I have a variable private String search;
in my action class to which I am expecting the search box string should be assigned.
Please help me which this. Do I need to add any jar files of datatable1.10 version to my project( I am not sure If we have any jar).
Here is my JQuery Code:
var oTable=$(".IncomeTable").dataTable({
"paging":true,
"searching": true,
"bProcessing" : true,
"bServerSide" : true,
"bJQueryUI" : true,
"info":true,
"bAutoWidth": false,
"iDisplayLength": 10,
"aLengthMenu": [[10, 15], [10, 15]],
"sPaginationType" : "full_numbers",
"ajax" : "PaginationAction",
"aoColumns": [
{"mData":"description","bSearchable": true,"bSortable": true},
{"mData":"catergory.userCodeName","bSearchable": false,"bSortable": false},
{"mData":"payee.payeeName","bSearchable": false,"bSortable": false},
{"mData":"transactionDate","bSearchable": false,"bSortable": false},
{"mData":"amount","sWidth":"30px","bSearchable": false,"bSortable": false}]
});
Action Class variables:
private int iTotalRecords;
private int iTotalDisplayRecords;
private int iDisplayLength;
private String sEcho;
private String sColumns;
private String sSearch;
private String search;
private String sKeyword;
private List<Income> aaData;
Note: all the integer values are coming as '0
' and string variables as null