rsr/yii2-button-dropdown-sorter

Bootstrap ButtonDropdown to use as sorter in yii2

Installs: 14 136

Dependents: 0

Suggesters: 0

Security: 0

Stars: 9

Watchers: 5

Forks: 2

Open Issues: 0

Type:yii2-extension

1.0.5 2015-04-12 19:41 UTC

This package is auto-updated.

Last update: 2024-04-09 06:32:43 UTC


README

Bootstrap ButtonDropdown to use as sorter in yii2 widgets

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require rsr/yii2-button-dropdown-sorter

or add

"rsr/yii2-button-dropdown-sorter": "*"

to the require section of your composer.json file.

Usage

In widgets that have the sorter, like ListView, set the "class" attribute to "rsr\yii2\ButtonDropdownSorter". There is an optional "label" attribute which defines the label of the button which defaults to "Sort". Be sure the {sorter} is present in widget's template.

Example:

<?= ListView::widget([
		'dataProvider' => $dataProvider,
		'itemView' => '_views',
		'layout' => "{sorter}\n{summary}\n{items}\n{pager}",
		'sorter' => [
			'class' => 'rsr\yii2\ButtonDropdownSorter',
			'label' => 'Sort Items',
		],
]); ?>

Resources