Merge pull request #4377 from howdu/fix-limit-per-page
Fix limit per page for datagrid
This commit is contained in:
commit
82d457f328
|
|
@ -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
|
||||
]);
|
||||
|
|
|
|||
|
|
@ -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: {
|
||||
|
|
|
|||
Loading…
Reference in New Issue