I have a page (table.php) with a script for Datatables that is calling "table_data.php" as the sAjaxSource.
I'm trying to add a single drop down filter above the datatables table, to control what set of data the datatable starts with. The problem is, the Ajax data file (table_data.php) does not have access to the POST variables and I don't see a method of passing variables to it through the sAjaxSource call of the dataTable({}) instantiation script.
How would I call the ajax data file and pass the POST variable from the main page form drop down, so that the Ajax data file has the POST variable?
Basically, I'm just trying to add this into the SQL query on the ajax data file:
if (!empty($location_post_variable)){
$query .= " AND a.location= '" . $location_post_variable. "'";
} else {
$query .= " AND a.location= '" . $location_default. "'";
}
Thanks. Perhaps there's a better way of doing this like maybe adding a single drop down filter to the datatables object itself, to control what set of data it starts with?