André Castro
André Castro

Reputation: 1565

Yii2 - Kartik Grid Extension Error

I have made many attempts to install Kartik Grid Extension, but all of them failed due to this error:

Setting unknown property: yii\bootstrap\ButtonDropdown::containerOptions

The error is located in /Applications/MAMP/htdocs/business/vendor/yiisoft/yii2/base/Component.php

at line 197

My view as the code:

use kartik\grid\GridView;

<?= GridView::widget([
    'dataProvider' => $dataProvider,
    'filterModel' => $searchModel,
    'columns' => [
        ['class' => 'yii\grid\SerialColumn'],

        'id',
        'nome',
        'email:email',
        'telefone',
        'mensagem:ntext',

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

and configured modules in web.php has:

'gridview' =>  [
    'class' => '\kartik\grid\Module'
    // enter optional module parameters below - only if you need to  
    // use your own export download action or custom translation 
    // message source
    // 'downloadAction' => 'gridview/export/download',
    // 'i18n' => []
    ],

Also updated composer with sudo update composer.

Any idea what is causing this error, i can't find a solution for hours!

I need a grid that can export to Excel and PDF. I have installed mpdf extension as well.

Many thanks.

Upvotes: 0

Views: 3720

Answers (1)

Andr&#233; Castro
Andr&#233; Castro

Reputation: 1565

SOLVED, by running in the terminal (mac osx yosemite), and inside the website folder, the following command: SUDO COMPOSER UPDATE.

Basically it updated the framework and all it's extension's to the latest versions.

After the update the grid appeared, and everything was working ok inside it.

Activated the toolbar with export button to excel and pdf, and the job was done :)

Best regards.

Upvotes: 0

Related Questions