Prevent serverside processing in fnServerParams
Prevent serverside processing in fnServerParams
Following is my code:
"fnServerParams": function (oData) {
if((sDateTime == undefined || sDateTime =="") && $('#measurement_length select').val() == -2 ){
alert("Please select date")
return false;
}
if($('#measurement_length select').val() == -2 ){
sData = " start_time <= '"+sDateTime+"'";
if($('#measurement_length select').val() == -2 ) {
sData += " group by name "
}
oData.push({ "name": "extra_sql", "value": sData });
}
}
I need to send additional data to the server side script only if the iDisplayLength is -2 and sDateTime is defined to valid value. However, regardless of setting return false, the data is requested. How do I pervent this?
Answers
Found the solution.
Added the check in fnPreDrawCallback instead.