mirror of
https://github.com/snipe/snipe-it.git
synced 2025-03-05 20:52:15 -08:00
Fixed - Added a “clear selection” option to select2 ajax lists
This commit is contained in:
parent
15d4344efb
commit
d68d95a915
|
@ -19,7 +19,7 @@ class SelectlistTransformer
|
||||||
|
|
||||||
public function transformSelectlist (LengthAwarePaginator $select_items)
|
public function transformSelectlist (LengthAwarePaginator $select_items)
|
||||||
{
|
{
|
||||||
$items_array = [];
|
|
||||||
|
|
||||||
// Loop through the paginated collection to set the array values
|
// Loop through the paginated collection to set the array values
|
||||||
foreach ($select_items as $select_item) {
|
foreach ($select_items as $select_item) {
|
||||||
|
@ -32,6 +32,9 @@ class SelectlistTransformer
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// This is weird and awful, but the only way I can find to allow the user to
|
||||||
|
// clear the selection - @snipe
|
||||||
|
array_unshift($items_array, ['id' =>'', 'text'=> trans('general.clear_selection')]);
|
||||||
$results = [
|
$results = [
|
||||||
'items' => $items_array,
|
'items' => $items_array,
|
||||||
'pagination' =>
|
'pagination' =>
|
||||||
|
|
|
@ -40,6 +40,7 @@
|
||||||
'checkout' => 'Checkout',
|
'checkout' => 'Checkout',
|
||||||
'city' => 'City',
|
'city' => 'City',
|
||||||
'click_here' => 'Click here',
|
'click_here' => 'Click here',
|
||||||
|
'clear_selection' => 'Clear Selection',
|
||||||
'companies' => 'Companies',
|
'companies' => 'Companies',
|
||||||
'company' => 'Company',
|
'company' => 'Company',
|
||||||
'component' => 'Component',
|
'component' => 'Component',
|
||||||
|
|
Loading…
Reference in a new issue