mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-11 13:57:41 -08:00
Fixed #9085 - asset models not showing proper pagination
Huge thanks to @inietov for catching this one
This commit is contained in:
parent
57e52f0ba4
commit
f37d5d3d03
|
@ -96,8 +96,9 @@ class AssetModelsController extends Controller
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$total = $assetmodels->count();
|
||||||
$assetmodels = $assetmodels->skip($offset)->take($limit)->get();
|
$assetmodels = $assetmodels->skip($offset)->take($limit)->get();
|
||||||
return (new AssetModelsTransformer)->transformAssetModels($assetmodels, $assetmodels->count());
|
return (new AssetModelsTransformer)->transformAssetModels($assetmodels, $total);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -55,24 +55,23 @@
|
||||||
@endif
|
@endif
|
||||||
<div class="table-responsive">
|
<div class="table-responsive">
|
||||||
<table
|
<table
|
||||||
data-side-pagination="server"
|
|
||||||
data-columns="{{ \App\Presenters\AssetModelPresenter::dataTableLayout() }}"
|
data-columns="{{ \App\Presenters\AssetModelPresenter::dataTableLayout() }}"
|
||||||
data-cookie-id-table="modelsTable"
|
data-cookie-id-table="asssetModelsTable"
|
||||||
data-pagination="true"
|
data-pagination="true"
|
||||||
data-id-table="modelsTable"
|
data-id-table="asssetModelsTable"
|
||||||
data-search="true"
|
data-search="true"
|
||||||
|
data-show-footer="true"
|
||||||
|
data-side-pagination="server"
|
||||||
data-show-columns="true"
|
data-show-columns="true"
|
||||||
data-toolbar="#toolbar"
|
data-toolbar="#toolbar"
|
||||||
data-show-export="true"
|
data-show-export="true"
|
||||||
data-show-refresh="true"
|
data-show-refresh="true"
|
||||||
data-sort-order="asc"
|
data-sort-order="asc"
|
||||||
data-page-size='30'
|
id="asssetModelsTable"
|
||||||
id="modelsTable"
|
|
||||||
data-url="{{ route('api.models.index', ['status'=> e(Request::get('status'))]) }}"
|
|
||||||
class="table table-striped snipe-table"
|
class="table table-striped snipe-table"
|
||||||
|
data-url="{{ route('api.models.index') }}"
|
||||||
data-export-options='{
|
data-export-options='{
|
||||||
"fileName": "export-asset-models-{{ date('Y-m-d') }}",
|
"fileName": "export-models-{{ date('Y-m-d') }}",
|
||||||
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
|
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
|
||||||
}'>
|
}'>
|
||||||
</table>
|
</table>
|
||||||
|
|
Loading…
Reference in a new issue