Installed the DynaGrid
plugin and ran into the problem of expanding it. I created my own class DynaGridViewAdvanced
, which is located on the path modules/appWidgets/widgets/grid
and has namespace app\modules\appWidgets\widgets\grid
.
The class code is as follows:
<?php
declare(strict_types=1);
namespace app\modules\appWidgets\widgets\grid;
use kartik\dynagrid\DynaGrid;
use Yii;
use yii\helpers\Url;
class DynaGridViewAdvanced extends DynaGrid {
/**
* @var bool активность функции перехода на просмотр при двойном клике
*/
public $transitionToView = false;
public function init() {
parent::init(); // TODO: Change the autogenerated stub
if ($this->transitionToView && empty($this->rowOptions)) {
$this->rowOptions = function($model, $key, $index, $grid) {
$viewLink = Url::toRoute(['/' . Yii::$app->controller->id . '/view']);
return ['ondblclick' => 'location.href="' . $viewLink . '?id="+(this.dataset.key);'];
};
}
}
public function run() {
parent::run(); // TODO: Change the autogenerated stub
}
}
Actually, the question is why the error is thrown out and how to fix it?
View not Found – yii\base\ViewNotFoundException
The view file does not exist: /var/www/urs/modules/appWidgets/widgets/grid/views/config.php
In DynaGrid
itself there is a property _module
, which stores in itself kartik\dynagrid\Module
, in which there is a property configView
. configView
is used only in DynaGrid
itself:
$dynagrid = $this->render(
$this->_module->configView,
[...]
)
As far as I understand the error, he is trying to find this configuration view file exactly with namespace
.
See the full error page: