include space in search filter
include space in search filter
lawnder00
Posts: 7Questions: 4Answers: 0
I have this code but i can't do a search filter with space or comma
$(document).ready(function () {
oDtable = $('#exc').dataTable({
"scrollX": true,
"scrollY": 300,
"oSearch": { "bSmart": false, "bRegex": true },
"processing": true,
"serverSide": true,
"ajax": "/ajax/getJSONResultsForDT?table=eventos&primaryKey=id",
"columns": [
{"data": 'nombre'},
{"data": 'descripcion'},
{"data": 'fecha_inicio'},
{"data": 'fecha_fin'},
{"data": "created_by"},
{"data": "updated_by"},
{"data": null}, //6 y 7
{"data": null}
],
"columnDefs": [
{
"targets": [6],
"orderable": false,
"render": function (data) {
$id = data.id;
return '<button class="btn btn-default" data-toggle="modal" data-target="#edit-modal">Edit</button>';
}
},
{
"targets": [7],
"orderable": false,
"render": function (data) {
return '<a class="btn btn-danger" data-fancybox-type="iframe">' + 'Delete' + '</a>';
}
}],
"bPaginate": true,
"sPaginationType": "full_numbers",
});
});
This discussion has been closed.
Answers
It is up to your server-side script (
/ajax/getJSONResultsForDT?table=eventos&primaryKey=id
) how filtering is done since you've enabled server-side processing. If there is a filtering problem, then the issue is in that script.Allan
This is my filter
//------------
static function filter ( $request, $columns, &$bindings )
{
$globalSearch = array();
$columnSearch = array();
$dtColumns = Datatables_SSP::pluck( $columns, 'dt' );