承接 kl83/yii2-grid-sortable-column 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

kl83/yii2-grid-sortable-column

最新稳定版本:v1.0.0

Composer 安装命令:

composer require kl83/yii2-grid-sortable-column

包简介

Sortable column for Yii2 GridView

README 文档

README

Latest Stable Version Total Downloads License

The GridView column class for sorting rows. Looks like this:

Preview

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require kl83/yii2-grid-sortable-column ~1.0.0

or add

"kl83/yii2-grid-sortable-column": "~1.0.0"

to the require section of your composer.json file.

Usage

Add column

<?= GridView::widget([
    'id' => 'gridview',
    'dataProvider' => $dataProvider,
    'filterModel' => $searchModel,
    'columns' => [
        [ 'class' => 'kl83\grid\SortableColumn' ],
        'title',
        'type',
        [ 'class' => 'yii\grid\ActionColumn' ],
    ],
]); ?>

Listen GridView event

$this->registerJs("
    $('#gridview').bind('sortablecolumn-sort', function ( e, data ) {
        // Sending data to the server
        $.get('/move-row', {
            itemId: data.itemId, // The key of the dragged row
            prevId: data.prevId, // The key of the previous row, false if the row is the first
            nextId: data.nextId  // The key of the next row, false if the row is the last
        });
    });
");

License

MIT License

统计信息

  • 总下载量: 10.4k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-07-04