Dynamic Select setting (#13179)

* Dynamic Select setting
embeds select2 and uses ajax to call to backend for options
poller-group included

* fix validation a bit

* fix typehint

* move minProperties into the select schema

* Change dashboard-select to select-dynamic
Love deleting code

* Change dashboard-select to select-dynamic
Love deleting code
wire up a few select2 options

* fix whitespace

* Not a model, just an object

* Suggestion from @SourceDoctor autocomplete values of select and select-dynamic

Got a little creative with InternalHttpRequest...
This commit is contained in:
Tony Murray
2021-08-28 06:46:53 -05:00
committed by GitHub
parent 94ee737f3d
commit d646562e4e
13 changed files with 346 additions and 109 deletions

View File

@@ -51,7 +51,10 @@ abstract class SelectController extends PaginatedAjaxController
$this->validate($request, $this->rules());
$limit = $request->get('limit', 50);
$query = $this->search($request->get('term'), $this->baseQuery($request), $this->searchFields($request));
$query = $this->baseQuery($request)->when($request->has('id'), function ($query) {
return $query->whereKey(request('id'));
});
$query = $this->search($request->get('term'), $query, $this->searchFields($request));
$this->sort($request, $query);
$paginator = $query->simplePaginate($limit);