diff --git a/vendor/blobt/grid/GridView.php b/vendor/blobt/grid/GridView.php index bd3ebc4..b57b575 100644 --- a/vendor/blobt/grid/GridView.php +++ b/vendor/blobt/grid/GridView.php @@ -43,7 +43,8 @@ use blobt\web\GridViewAsset; * @email 380255922@qq.com * @created Aug 13, 2019 */ -class GridView extends BaseListView { +class GridView extends BaseListView +{ /** * @var string 渲染列数据的类,默认是'yii\grid\DataColumn' @@ -66,12 +67,12 @@ class GridView extends BaseListView { public $tableOptions = ['class' => 'table table-bordered table-hover dataTable']; /** - * @var array 表格头部html属性 + * @var array 表格头部html属性 */ public $headerRowOptions = []; /** - * @var array 表格脚部html属性 + * @var array 表格脚部html属性 */ public $footerRowOptions = []; @@ -153,7 +154,7 @@ class GridView extends BaseListView { * ] * ``` * - * 当然,也支持简写成这样:[[DataColumn::attribute|attribute]], [[DataColumn::format|format]], + * 当然,也支持简写成这样:[[DataColumn::attribute|attribute]], [[DataColumn::format|format]], * 或 [[DataColumn::label|label]] options: `"attribute:format:label"`. * 所以上面例子的 "name" 列能简写成这样 : `"name:text:Name"`. * 甚至"format"和"label"都是可以不制定的,因为它们都有默认值。 @@ -194,7 +195,7 @@ class GridView extends BaseListView { public $filterSelector = 'select[name="per-page"]'; /** - * @var type + * @var type */ public $filter; @@ -221,7 +222,15 @@ class GridView extends BaseListView {
{batch} 添加 - + +
+ + +
+
{filter} @@ -262,7 +271,8 @@ HTML; * 初始化必须的属性和每个列对象 * @return */ - public function init() { + public function init() + { parent::init(); if ($this->formatter === null) { $this->formatter = Yii::$app->getFormatter(); @@ -276,21 +286,24 @@ HTML; $this->initColumns(); } - public function run() { + public function run() + { $view = $this->getView(); GridViewAsset::register($view); $this->registerGridJs(); $this->registerIcheckJs(); $this->registerConfirmJs(); + $this->registerExportJs(); parent::run(); } /** * 注册GridView Js */ - protected function registerGridJs() { + protected function registerGridJs() + { $options = Json::htmlEncode(['filterUrl' => Url::to(Yii::$app->request->url), - 'filterSelector' => $this->filterSelector]); + 'filterSelector' => $this->filterSelector]); $id = $this->options['id']; $this->getView()->registerJs("jQuery('#$id').yiiGridView($options);"); } @@ -298,7 +311,8 @@ HTML; /** * 注册icheck Js */ - protected function registerIcheckJs() { + protected function registerIcheckJs() + { $js = <<