Hello,
i have a datatable setup serverside, all working great except i can not get OR search working, for instance:
"Word Anotherword"
It will not look for "Word" OR "Anotherword" but for "Word Anotherword".
I have looked at multiple posts but they did not helpe me as it seems to be already be implemented what these posts suggest.
My DataTableInitiation is like this:
new DataTable('#example', {
"search":
{
"regex" : true,
smart : false
},
ajax: 'php/xxxx.php',
columns: [
{ data: 'xxx', "regex":true }
],
processing: true,
serverSide: true,
;
I do have a search for every column which calls this:
column.search(input.value, true, false).draw();
The Payload also looks fine to me:
(EDIT: gave column payloard first)
start: 0
length: 10
search[value]: ges kla
search[regex]: true
The php script seems to already have the functionality but i still get 0 results:
if ( count( $globalSearch ) ) {
$where = '('.implode(' OR ', $globalSearch).')';
}
if ( count( $columnSearch ) ) {
$where = $where === '' ?
implode(' AND ', $columnSearch) :
$where .' AND '. implode(' AND ', $columnSearch);
}
if ( $where !== '' ) {
$where = 'WHERE '.$where;
}
return $where;
There is only one custom change i made to the sspclass, which is hardcoded the max amount of data output with the max_items variable im passing, but if i understood correctly this should not be the issue as it gets applied after the sql search:
return array(
"draw" => isset ( $request['draw'] ) ?
intval( $request['draw'] ) :
0,
"limit" => $limit,
"recordsTotal" => intval( $recordsTotal ),
"recordsFiltered" => intval( $recordsFiltered ),
"data" => self::data_output( $columns, $data, $max_items)
);
I hope youre not annoyed, but all the posts did not help me yet.
Thanks in advance.