Skip to content

Commit

Permalink
Merge pull request #14464 from snipe/features/toggle_all_columns
Browse files Browse the repository at this point in the history
Added "toggle all" to column selector
  • Loading branch information
snipe committed Mar 20, 2024
2 parents d8378f2 + dce19e0 commit de18e44
Show file tree
Hide file tree
Showing 15 changed files with 22 additions and 9 deletions.
1 change: 1 addition & 0 deletions app/Presenters/AccessoryPresenter.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public static function dataTableLayout()
'field' => 'name',
'searchable' => true,
'sortable' => true,
'switchable' => false,
'title' => trans('general.name'),
'formatter' => 'accessoriesLinkFormatter',
], [
Expand Down
1 change: 1 addition & 0 deletions app/Presenters/AssetMaintenancesPresenter.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ public static function dataTableLayout()
'field' => 'title',
'searchable' => true,
'sortable' => true,
'switchable' => false,
'title' => trans('admin/asset_maintenances/form.title'),
], [
'field' => 'start_date',
Expand Down
1 change: 1 addition & 0 deletions app/Presenters/AssetModelPresenter.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public static function dataTableLayout()
'field' => 'name',
'searchable' => true,
'sortable' => true,
'switchable' => false,
'visible' => true,
'title' => trans('general.name'),
'formatter' => 'modelsLinkFormatter',
Expand Down
3 changes: 2 additions & 1 deletion app/Presenters/AssetPresenter.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ public static function dataTableLayout()
'field' => 'asset_tag',
'searchable' => true,
'sortable' => true,
'switchable' => false,
'title' => trans('admin/hardware/table.asset_tag'),
'visible' => true,
'formatter' => 'hardwareLinkFormatter',
Expand Down Expand Up @@ -316,7 +317,7 @@ public static function dataTableLayout()
'field' => 'checkincheckout',
'searchable' => false,
'sortable' => false,
'switchable' => true,
'switchable' => false,
'title' => trans('general.checkin').'/'.trans('general.checkout'),
'visible' => true,
'formatter' => 'hardwareInOutFormatter',
Expand Down
1 change: 1 addition & 0 deletions app/Presenters/CategoryPresenter.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public static function dataTableLayout()
'field' => 'name',
'searchable' => true,
'sortable' => true,
'switchable' => false,
'title' => trans('general.name'),
'visible' => true,
'formatter' => 'categoriesLinkFormatter',
Expand Down
2 changes: 1 addition & 1 deletion app/Presenters/CompanyPresenter.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public static function dataTableLayout()
'field' => 'name',
'searchable' => true,
'sortable' => true,
'switchable' => true,
'switchable' => false,
'title' => trans('admin/companies/table.name'),
'visible' => true,
'formatter' => 'companiesLinkFormatter',
Expand Down
2 changes: 1 addition & 1 deletion app/Presenters/ComponentPresenter.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ public static function dataTableLayout()
'field' => 'checkincheckout',
'searchable' => false,
'sortable' => false,
'switchable' => true,
'switchable' => false,
'title' => trans('general.checkin').'/'.trans('general.checkout'),
'visible' => true,
'formatter' => 'componentsInOutFormatter',
Expand Down
1 change: 1 addition & 0 deletions app/Presenters/ConsumablePresenter.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public static function dataTableLayout()
'field' => 'name',
'searchable' => true,
'sortable' => true,
'switchable' => false,
'title' => trans('general.name'),
'visible' => true,
'formatter' => 'consumablesLinkFormatter',
Expand Down
1 change: 1 addition & 0 deletions app/Presenters/DepreciationPresenter.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public static function dataTableLayout()
'field' => 'name',
'searchable' => true,
'sortable' => true,
'switchable' => false,
'title' => trans('general.name'),
'visible' => true,
'formatter' => 'depreciationsLinkFormatter',
Expand Down
1 change: 1 addition & 0 deletions app/Presenters/DepreciationReportPresenter.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ public static function dataTableLayout()
"field" => "name",
"searchable" => true,
"sortable" => true,
'switchable' => false,
"title" => trans('admin/hardware/form.name'),
"visible" => false,
], [
Expand Down
5 changes: 3 additions & 2 deletions app/Presenters/LicensePresenter.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public static function dataTableLayout()
'field' => 'name',
'searchable' => true,
'sortable' => true,
'switchable' => false,
'title' => trans('general.name'),
'formatter' => 'licensesLinkFormatter',
], [
Expand Down Expand Up @@ -186,7 +187,7 @@ public static function dataTableLayout()
'field' => 'checkincheckout',
'searchable' => false,
'sortable' => false,
'switchable' => true,
'switchable' => false,
'title' => trans('general.checkin').'/'.trans('general.checkout'),
'visible' => true,
'formatter' => 'licensesInOutFormatter',
Expand Down Expand Up @@ -280,7 +281,7 @@ public static function dataTableLayoutSeats()
'field' => 'checkincheckout',
'searchable' => false,
'sortable' => false,
'switchable' => true,
'switchable' => false,
'title' => trans('general.checkin').'/'.trans('general.checkout'),
'visible' => true,
'formatter' => 'licenseSeatInOutFormatter',
Expand Down
1 change: 1 addition & 0 deletions app/Presenters/LocationPresenter.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public static function dataTableLayout()
'field' => 'name',
'searchable' => true,
'sortable' => true,
'switchable' => false,
'title' => trans('admin/locations/table.name'),
'visible' => true,
'formatter' => 'locationsLinkFormatter',
Expand Down
1 change: 1 addition & 0 deletions app/Presenters/ManufacturerPresenter.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public static function dataTableLayout()
'field' => 'name',
'searchable' => true,
'sortable' => true,
'switchable' => false,
'title' => trans('admin/manufacturers/table.name'),
'visible' => true,
'formatter' => 'manufacturersLinkFormatter',
Expand Down
4 changes: 2 additions & 2 deletions app/Presenters/UserPresenter.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public static function dataTableLayout()
'searchable' => false,
'sortable' => false,
'switchable' => true,
'title' => 'Avatar',
'title' => trans('general.importer.avatar'),
'visible' => false,
'formatter' => 'imageFormatter',
],
Expand Down Expand Up @@ -175,7 +175,7 @@ public static function dataTableLayout()
'field' => 'username',
'searchable' => true,
'sortable' => true,
'switchable' => true,
'switchable' => false,
'title' => trans('admin/users/table.username'),
'visible' => true,
'formatter' => 'usersLinkFormatter',
Expand Down
6 changes: 4 additions & 2 deletions resources/views/partials/bootstrap-table.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,14 @@ classes: 'table table-responsive table-no-bordered',
stickyHeader: true,
stickyHeaderOffsetLeft: parseInt($('body').css('padding-left'), 10),
stickyHeaderOffsetRight: parseInt($('body').css('padding-right'), 10),
locale: locale,
locale: '{{ app()->getLocale() }}',
undefinedText: '',
iconsPrefix: 'fa',
cookieStorage: '{{ config('session.bs_table_storage') }}',
cookie: true,
cookieExpire: '2y',
showColumnsToggleAll: true,
minimumCountColumns: 2,
mobileResponsive: true,
maintainSelected: true,
trimOnSearch: false,
Expand Down Expand Up @@ -85,7 +87,7 @@ classes: 'table table-responsive table-no-bordered',
export: 'fa-download',
clearSearch: 'fa-times'
},
exportOptions: export_options,
exportOptions: export_options,
exportTypes: ['xlsx', 'excel', 'csv', 'pdf','json', 'xml', 'txt', 'sql', 'doc' ],
onLoadSuccess: function () {
$('[data-tooltip="true"]').tooltip(); // Needed to attach tooltips after ajax call
Expand Down

0 comments on commit de18e44

Please sign in to comment.