Html builder - search parameter
Html builder - search parameter
Hello community !!
I'm beginner with datatable, i'm using PHP Laravel 8.
I created an html builder to setup my datatable with the following code :
$builder = $this->builder()
->columns($this->getColumns())
->minifiedAjax()
->parameters([
'search' => ['return' => true],
'responsive' => true,
'dom' => 'Bfrtip',
'language' => ['url' => Utilities::getFileLocationDatatable()],
'stateSave' => true,
'order' => [[0, 'desc']],
'buttons' => [
],
'drawCallback' => "function() {
$('[data-toggle=\"tooltip\"]').tooltip();
}",
]);
But strangely the parameter 'search' => ['return' => true] seems not working, the goal is to run search when 'enter' key is pressed but it run search everytime any key is pressed in search zone.
I'm really beginner so i may misunderstood the syntaxe of the documentation, be indulgent.
Thanks in advance
Olivier
This question has an accepted answers - jump to answer
Answers
I don't know about Laravel 8, but
search
is an object, so you may need to replace:with
Colin
Thanks for your reply Colin, but the syntaxe is correct, to acces an object in laravel 'search' => ['return' => true] is ok
Are you using DataTables 1.11?
search.return
was introduced in 1.11.0 (current release is 1.11.5 as I write this).If that isn't the issue, then we'll need a link to a page showing the issue to be able to debug it.
Allan
Thanks Allan, we are using on older version.
Willl try to update it.
Olivier