使用yii2 生成管理列表,有 checkboxcolumns::classname()这个可以生成复选框,但这个“批量提交”的按钮是放到哪里?我想把批量删除的按钮放在gridview 生成的
里面,但是却无法控制的,除非修改 /vendor/里面的类, gridview (d:\website\yii2\basic\vendor\yiisoft\yii2\grid\gridview.php) 方法 rendertablefooter,如何生成
。
# 文件 d:\website\yii2\basic\vendor\yiisoft\yii2\grid\gridview.php /** * renders the table footer. * @return string the rendering result. */ public function rendertablefooter() { $cells = []; foreach ($this->columns as $column) { /* @var $column column */ $cells[] = $column->renderfootercell(); } $content = html::tag('tr', implode('', $cells), $this->footerrowoptions); if ($this->filterposition == self::filter_pos_footer) { $content .= $this->renderfilters(); } return \n . $content . \n; }
foreach 这个里面已经无法控制 colunms 了,无法生成
,yii2如何使用批量功能?
回复内容: 使用yii2 生成管理列表,有 checkboxcolumns::classname()这个可以生成复选框,但这个“批量提交”的按钮是放到哪里?我想把批量删除的按钮放在gridview 生成的
里面,但是却无法控制的,除非修改 /vendor/里面的类, gridview (d:\website\yii2\basic\vendor\yiisoft\yii2\grid\gridview.php) 方法 rendertablefooter,如何生成
。
# 文件 d:\website\yii2\basic\vendor\yiisoft\yii2\grid\gridview.php /** * renders the table footer. * @return string the rendering result. */ public function rendertablefooter() { $cells = []; foreach ($this->columns as $column) { /* @var $column column */ $cells[] = $column->renderfootercell(); } $content = html::tag('tr', implode('', $cells), $this->footerrowoptions); if ($this->filterposition == self::filter_pos_footer) { $content .= $this->renderfilters(); } return \n . $content . \n; }
foreach 这个里面已经无法控制 colunms 了,无法生成
,yii2如何使用批量功能?
'showfooter'=>true,然后'footer'=>'批量删除'。
