kartik-v / yii2-dynagrid

Turbo charge the Yii 2 GridView with personalized columns, page size, and themes.
http://demos.krajee.com/dynagrid
Other
74 stars 66 forks source link

The '' module MUST be setup in your Yii configuration file. #229

Closed adamwinn closed 4 years ago

adamwinn commented 4 years ago

Prerequisites

Steps to reproduce the issue

I followed the docs and have this code but I get an error message

// fetches grid configuration
$store = new DynaGridStore([
    'id' => $this->options['id'], 
    'storage' => 'db',
    'userSpecific' => true,
    'category' => 'grid'
]);
return $store->fetch();

Expected behavior and actual behavior

Invalid Configuration – yii\base\InvalidConfigException
The '' module MUST be setup in your Yii configuration file.

The docs dont mention setting up the DynaGridStore module

I put this in and I still got the same message

    'modules' => [
        'dynagrid'=>[
            'class'=>'\kartik\dynagrid\Module',
            'defaultPageSize'=>200,
            'maxPageSize'=>1000,
        ],
        'dynagridstore'=>[
            'class'=>'\kartik\dynagridstore\Module',
        ],
        'gridview' =>  [
            'class' => '\kartik\grid\Module'
        ],
    ],

There seems to also be a bug in the error message as "" is empty

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

adamwinn commented 3 years ago

This issue is still happening

adamwinn commented 3 years ago

@kartik-v Please re-open this issue

asamats commented 1 year ago
$store = new DynaGridStore([
            'moduleId' => 'dynagrid',
            'id' => self::ID,
            'storage' => DynaGrid::TYPE_COOKIE,
            'userSpecific' => true,
            'category' => DynaGridStore::STORE_FILTER,
        ]);

where moduleId must be the key that is used in config

    'modules' => [
        'dynagrid' => \kartik\dynagrid\Module::class,
        'gridview' => \kartik\grid\Module::class,
    ],