mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-21 09:35:49 +02:00
Fixed search function.
This commit is contained in:
parent
ee496fb7bb
commit
120eb30b11
2 changed files with 3 additions and 2 deletions
|
@ -15,7 +15,8 @@
|
||||||
$.fn.initDataTables = function(config, options) {
|
$.fn.initDataTables = function(config, options) {
|
||||||
|
|
||||||
//Update default used url, so it reflects the current location (useful on single side apps)
|
//Update default used url, so it reflects the current location (useful on single side apps)
|
||||||
$.fn.initDataTables.defaults.url = window.location.origin + window.location.pathname;
|
//CHANGED jbtronics: Preserve the get parameters (needed so we can pass additional params to query)
|
||||||
|
$.fn.initDataTables.defaults.url = window.location.origin + window.location.pathname + window.location.search;
|
||||||
|
|
||||||
var root = this,
|
var root = this,
|
||||||
config = $.extend({}, $.fn.initDataTables.defaults, config),
|
config = $.extend({}, $.fn.initDataTables.defaults, config),
|
||||||
|
|
|
@ -203,7 +203,7 @@ class PartListsController extends AbstractController
|
||||||
*/
|
*/
|
||||||
public function showSearch(Request $request, DataTableFactory $dataTable)
|
public function showSearch(Request $request, DataTableFactory $dataTable)
|
||||||
{
|
{
|
||||||
$search = $request->get('keyword', '');
|
$search = $request->query->get('keyword', '');
|
||||||
|
|
||||||
$table = $dataTable->createFromType(PartsDataTable::class, ['search' => $search])
|
$table = $dataTable->createFromType(PartsDataTable::class, ['search' => $search])
|
||||||
->handleRequest($request);
|
->handleRequest($request);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue