sortablegridview Sortable Gridview for Yii2

  1. Requirements
  2. Usage
  3. Resources

Sometimes one needs a more complex jquery sortable element such that you can filter the elements in a bigger database and then be able to sort the results. Sortable Gridview fulfills this gap.

Requirements

Yii2

Usage

There is an additional attribute available sortOptions = []. It takes options from the jquery ui sortable

echo SortableGridview::widget([
            'dataProvider' => $dataProvider,
            'filterModel' => $filterModel,
            'options' => [
                'id' => 'targetTable',
                'class' => 'grid-view'
            ],
            'sortOptions' => [
                'placeholder' => 'ui-state-highlight',
                'cursor' => 'move',
                'receive' => new JsExpression("function(event, ui) {
                    console.log('receive');
                }"),
                'change' => new JsExpression("function(event, ui) {
                    console.log('change');
                }"),
            ],
            'columns' => [

                'id',
                'title',
            ],
        ]);

Resources

0 0
2 followers
0 downloads
Yii Version: Unknown
License: GPL-3.0
Category: User Interface
Developed by: bettor
Created on: Mar 6, 2014
Last updated: 10 years ago

Related Extensions