Yii2 - Export Kartik-v

2019-09-14 16:57发布

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

enter image description here

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

0条回答
登录 后发表回答