Merge pull request #4377 from howdu/fix-limit-per-page

Fix limit per page for datagrid
This commit is contained in:
Jitendra Singh 2020-12-23 15:36:49 +05:30 committed by GitHub
commit 82d457f328
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 6 deletions

View File

@ -715,6 +715,7 @@ abstract class DataGrid
'enableMassActions' => $this->enableMassAction,
'enableActions' => $this->enableAction,
'paginated' => $this->paginate,
'itemsPerPage' => $this->itemsPerPage,
'norecords' => __('ui::app.datagrid.no-records'),
'extraFilters' => $necessaryExtraFilters
]);

View File

@ -101,11 +101,7 @@
<select id="perPage" name="perPage" class="control" v-model="perPage"
v-on:change="paginate">
<option value="10"> 10</option>
<option value="20"> 20</option>
<option value="30"> 30</option>
<option value="40"> 40</option>
<option value="50"> 50</option>
<option v-for="index in this.perPageProduct" :key="index" :value="index"> @{{ index }} </option>
</select>
</div>
</div>
@ -306,7 +302,8 @@
booleanConditionSelect: false,
numberConditionSelect: false,
datetimeConditionSelect: false,
perPage: 10,
perPage: {{ $results['itemsPerPage'] ?: 10 }},
perPageProduct: [10, 20, 30, 40, 50],
extraFilters: @json($results['extraFilters']),
}
},
@ -321,6 +318,10 @@
}
}
}
if (this.perPageProduct.indexOf(parseInt(this.perPage)) === -1) {
this.perPageProduct.unshift(this.perPage);
}
},
methods: {