mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-12 06:17:28 -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)
|
||||
{
|
||||
$items_array = [];
|
||||
|
||||
|
||||
// Loop through the paginated collection to set the array values
|
||||
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 = [
|
||||
'items' => $items_array,
|
||||
'pagination' =>
|
||||
|
|
|
@ -40,6 +40,7 @@
|
|||
'checkout' => 'Checkout',
|
||||
'city' => 'City',
|
||||
'click_here' => 'Click here',
|
||||
'clear_selection' => 'Clear Selection',
|
||||
'companies' => 'Companies',
|
||||
'company' => 'Company',
|
||||
'component' => 'Component',
|
||||
|
|
Loading…
Reference in a new issue