Quantcast
Channel: DataTables 1.9 — DataTables forums
Viewing all articles
Browse latest Browse all 1816

Server Side values not getting set in DataTable..Help Please

$
0
0
At (Server Side) Java level: Here is what I am doing
responseJSONObject.put("sEcho", 3);
responseJSONObject.put("iTotalRecords",jsonArray.length());
responseJSONObject.put("aaSorting",sortingArray);
responseJSONObject.put("iTotalDisplayRecords", "25");
responseJSONObject.put("aaData", jsonArray);
resourceResponse.setContentType("application/json");
resourceResponse.getWriter().print(responseJSONObject.toString());
resourceResponse.getWriter().flush();

Javascript level:
****************
jQuery('#MyDataTable').dataTable({
	"bJQueryUI": true,
	"bServerSide": true,
	"bProcessing": true,
	"sDom": '<"H"<i><"datatables-header-length"l><"datatables-header-pagination"p><f>r>t<"F"p>',
	"sPaginationType": "full_numbers",
	"bStateSave": true,
	"sAjaxSource": "<%= viewPortletResourceURL.toString() %>",
	"fnServerData": function (sSource, data, fnCallback) {
			                         jQuery.ajax({	"dataType": 'json', 
		                                                        "type": "POST", 
                                                                         "url": sSource, 
                                                                         "data": data,
                                                                          "success": [fnCallback, someFn],
                                                                          "error": someFn
                                                                   });
                                               },
 });

So my issue I pretty sure values getting set as following Description got updated with what values I set
This gets updated:
"Showing 1 to 25 of 25 entries (filtered from 50 total entries)"
But the drop down from which user select number of pages to be displayed not getting updated also datatable is still displaying all 50 records whereas it should display 25 records. I am damn sure I am missing something here
here is JSON OBject that I am passing :(
{"aaSorting":[2,"asc"],"iTotalRecords":"50","iTotalDisplayRecords":"25","sEcho":3,
"aaData":.....}
aaData part is working just fine but none of the others are getting replicated :( please HELP ;(

I am kind of really tough deadline.....really I am beating my head off but cant find the solution, followed exactly what all the internet examples was saying but still not able to fix that...I think I am missing some property/attribute

Viewing all articles
Browse latest Browse all 1816

Trending Articles