File tree Expand file tree Collapse file tree 4 files changed +11
-4
lines changed Expand file tree Collapse file tree 4 files changed +11
-4
lines changed Original file line number Diff line number Diff line change 11<?php
22/**
33 * @link https://github.com/himiklab/yii2-sortable-grid-view-widget
4- * @copyright Copyright (c) 2014 HimikLab
4+ * @copyright Copyright (c) 2014-2017 HimikLab
55 * @license http://opensource.org/licenses/MIT MIT
66 */
77
Original file line number Diff line number Diff line change 11<?php
22/**
33 * @link https://github.com/himiklab/yii2-sortable-grid-view-widget
4- * @copyright Copyright (c) 2014 HimikLab
4+ * @copyright Copyright (c) 2014-2017 HimikLab
55 * @license http://opensource.org/licenses/MIT MIT
66 */
77
Original file line number Diff line number Diff line change 11<?php
22/**
33 * @link https://github.com/himiklab/yii2-sortable-grid-view-widget
4- * @copyright Copyright (c) 2014 HimikLab
4+ * @copyright Copyright (c) 2014-2017 HimikLab
55 * @license http://opensource.org/licenses/MIT MIT
66 */
77
@@ -42,6 +42,9 @@ class SortableGridBehavior extends Behavior
4242 /** @var callable */
4343 public $ scope ;
4444
45+ /** @var callable */
46+ public $ afterGridSort ;
47+
4548 public function events ()
4649 {
4750 return [ActiveRecord::EVENT_BEFORE_INSERT => 'beforeInsert ' ];
@@ -67,6 +70,10 @@ public function gridSort($items)
6770 $ models [$ modelId ]->updateAttributes ([$ this ->sortableAttribute => $ orderValue ]);
6871 }
6972 });
73+
74+ if (is_callable ($ this ->afterGridSort )) {
75+ call_user_func ($ this ->afterGridSort , $ model );
76+ }
7077 }
7178
7279 public function beforeInsert ()
Original file line number Diff line number Diff line change 11<?php
22/**
33 * @link https://github.com/himiklab/yii2-sortable-grid-view-widget
4- * @copyright Copyright (c) 2014 HimikLab
4+ * @copyright Copyright (c) 2014-2017 HimikLab
55 * @license http://opensource.org/licenses/MIT MIT
66 */
77
You can’t perform that action at this time.
0 commit comments