Files
opensem/resources/views/components/datatables/buttons/pageLength.blade.php
2021-03-22 00:47:44 +01:00

21 lines
544 B
PHP

@include('components.select', ['name' => 'pager', 'id_name'=> $model . '_pager', 'list' => [5 => '5', 10 => '10', 25 => '25', 50 => '50', 100 => '100']])
  
@push('js')
<script>
$( document ).ready(function() {
var table = getDatatable("{{ $model }}");
var state = getDatatableState("{{ $model }}");
if (state && (typeof(state.length) != 'undefined')) {
$('#{{ $model }}_pager').val(state.length);
}
$('#{{ $model }}_pager').change(function() {
table.page.len($(this).val()).draw();
});
});
</script>
@endpush