Ihavethistableusingdatatable,andIneedtochangetheWHEREoftheselectthatfillsitifthe"View all users" checkbox is checked. I created this function to know if the checkbox is checked, now I need to send this users variable via Ajax to the file that assembles the select and recreate the table bringing all the records, how do I do that?
$('#all_users').click(function(){
if($(this).is(':checked') ) {
var users = 'all';
}
});
Table created
var tabela = $("#lista-dados").DataTable({
"processing": false,
"serverSide": true,
"autoWidth": true,
"ajax": {
"type": "POST",
"data": ws_datatable,
"url": "./functions/ws_datatable.php"
},
"order": [[ 2, "desc" ]],
"lengthMenu": [[10, 25, 50, 100, 250, 500, -1]],
"pageLength": 10,
"bStateSave": true,
"paging": true,
"dom": "lBfrtipr",
buttons: []
});