Yii2 - Export Kartik-v

二次信任 提交于 2019-12-12 03:58:20

问题


I have many tables that can be displayed in Yii2. One of them is like this:

We can download the table by clicking download button. Many tables can be download one by one. One table can only download its table. Actually, I want all of tables can be downloaded in one file. What I want to ask: Is there any way to download all of the tables and make them on one document?

Here is my view code:

<?php

use yii\helpers\Html;
use kartik\grid\GridView;
use yii\widgets\Pjax;
use yii\bootstrap\Model;
use yii\helpers\Url;
use kartik\export\ExportMenu;

/* @var $this yii\web\View */
/* @var $searchModel app\models\Temppelamarmagisterjk */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title = Yii::t('app', 'Pelamar Magister Berdasarkan Jenis Kelamin');
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="tempppelamarmagisterjk-index">

    <h1><?= Html::encode($this->title) ?></h1>
    <?php // echo $this->render('_search', ['model' => $searchModel]); ?>

    <p>
        <!--<?= Html::a(Yii::t('app', 'Create Jumlah Pelamar Magister'), ['create'], ['class' => 'btn btn-success']) ?> -->
    </p>
    <?php
        $gridColumns =[
            'TahunDaftar',
            'Lakilaki',
            'Perempuan',
            'TidakDiketahui',
            'Total'
        ];

        //Renders a export dropdown menu
        echo ExportMenu::widget([
            'dataProvider' => $dataProvider,
            'columns' => $gridColumns,
            'fontAwesome' => true,
            ]);
    ?>
    <?= GridView::widget([
        'dataProvider' => $dataProvider,
        'filterModel' => $searchModel,
        'columns' => [
            ['class' => 'yii\grid\SerialColumn'],

            'TahunDaftar',
            'Lakilaki',
            'Perempuan',
            'TidakDiketahui',
            'Total',

            ////['class' => 'yii\grid\ActionColumn'],
        ],
    ]); ?>
</div>

Thanks

来源:https://stackoverflow.com/questions/45319792/yii2-export-kartik-v

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!