How to generate batch operation buttons for the GridView of Yii2

Source: Internet
Author: User
When yii2 is used to generate a management list, there is a CheckboxColumns: className () which can generate a check box, but where is the "batch submit" button? I want to put the batch delete button in the & amp; lt; table & amp; gt; & amp; lt; tfooter & amp; gt; & amp; lt; tfooter & amp; gt; & amp; lt; t... use yii2 to generate a management list CheckboxColumns::className()This can generate check boxes, but where is the "batch submit" button? I want to put the batch delete button in GridViewGenerated
But cannot be controlled, unless modified /vendor/The class, the GridView ( D:\website\yii2\basic\vendor\yiisoft\yii2\grid\GridView.php) Method renderTableFooter, How to generate .

# File 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";}

In foreach, colunms cannot be controlled and cannot be generated. How does yii2 use the batch function?

Reply content:

Use yii2 to generate a management listCheckboxColumns::className()This can generate check boxes, but where is the "batch submit" button? I want to put the batch delete button inGridViewGenerated

But cannot be controlled, unless modified /vendor/The class, the GridView ( D:\website\yii2\basic\vendor\yiisoft\yii2\grid\GridView.php) Method renderTableFooter, How to generate .

# File 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";}

In foreach, colunms cannot be controlled and cannot be generated. How does yii2 use the batch function?

'Showfooter '=> true, and then 'footer' => 'batch delete '.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.