Search with server processing and POST -- generates an HTTP GET and POST

Search with server processing and POST -- generates an HTTP GET and POST

jamesjburtjamesjburt Posts: 8Questions: 0Answers: 0
edited June 2011 in Bug reports
I apologize if there turns out to be some trivial setting I missed. Here is the problem I observed:

My datatable is set for server processing, and http POST.

However, when I type in the "search/filter" box I notice that datatables generates:

BOTH
--- an Ajax GET
--- and
--- an Ajax POST

for the same search/filter request.

(That means TWO requests for each keypress / character typed!!!!)

Any idea why?

How can I disable the Ajax http GET?


Ok... I figured out my mistake. I had two AJAX requests coded inside of "fnServerData"

I had to remove this line:

[code]
$j.getJSON(sSource, aoData, function (json){fnCallback(json);});
[/code]



[code]


oTable5 = $j('#example5').dataTable
({
"sAjaxSource": '/myController/myMethod',
"aoColumns":
[
{"mDataProp": "FIRST_NAME", "sTitle": "First Name"},
{"mDataProp": "MIDDLE_NAME", "sTitle": "Middle Name"},
{"mDataProp": "LAST_NAME", "sTitle": "Last Name"}
],
"fnServerData": function (sSource, aoData, fnCallback)
{
var arrTemp = new Array();
var objCols = this.fnSettings().aoColumns;

for(var i=0; i
This discussion has been closed.