Download the PHP package integready/yii2-pagesize-widget without Composer
On this page you can find all versions of the php package integready/yii2-pagesize-widget. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download integready/yii2-pagesize-widget
More information about integready/yii2-pagesize-widget
Files in integready/yii2-pagesize-widget
Package yii2-pagesize-widget
Short Description Widget for enabling dynamic page size selection on GridView
License MIT
Homepage https://github.com/integready/yii2-pagesize-widget
Informations about the package yii2-pagesize-widget
yii2-pagesize-widget
PageSize widget is an extension to the Yii2 GridView that enables changing the size of a page on GridView.
Installation
The preferred way to install this extension is through composer.
Either run
or add
to the require section of your composer.json
file.
Usage
To use this widget with a GridView, add this widget to the view where the GridView is:
and set the filterSelector
property of GridView as shown in
following example.
<?= GridView::widget([
'dataProvider' => $dataProvider,
'filterModel' => $searchModel,
'filterSelector' => 'select[name="per-page"]',
'columns' => [
...
],
]); ?>
Please note that per-page
here is the string you use for pageSizeParam
setting of the PageSize widget.
Configurations
Following properties are available for customizing the widget.
label
: Text for the lbeldefaultPageSize
: This value will be used if there's no page size selectedpageSizeParam
: The name of the page size parameter used for the pagination widget in your grid viewsizes
: An array of key values to be used as page sizes. Both kay and value should be integerstemplate
: A template string to be used for rendering the elements. Default is'{list} {label}'
options
: HTML attributes for the<select>
elementlabelOptions
: HTML attributes for the<label>
elementencodeLabel
: Whether to encode label text
License
MIT