Hello,
i load a part of a view with renderAjax. This is my code in the controller:
return $this->render('index', [
'model' => $model,
'groups' => Products::getProductsList($code),
'editgroup'=>$editgroup,
'parent'=>Products::getField($code,'parent'),
'groupChildrens'=>Products::checkChildrens(Products::getField($code, 'id')),
'showGroupPath'=>Products::showGroupParentPath($model->id),
'numProductProjects'=>ProjectsProducts::getNumProductProjects(Products::getField($code, 'id')),
'productData'=>$this->renderAjax('/products/data', [
'model'=>$model,
'numProductProjects'=>ProjectsProducts::getNumProductProjects(Products::getField($code, 'id')),
'groupChildrens'=>Products::checkChildrens(Products::getField($code, 'id')),
]),
'productConfigurator'=>$this->renderAjax('/products/configurator', [
'product'=>$model->id,
'data'=>ProductsConfigurator::loadConfigurator($model->id),
'preview'=>ProductsConfigurator::showConfigurator($model->id),
'steps'=>ProductsConfigurator::getSteps($model->id),
]),
'projectList'=>Products::getProjectList($model->id),
]);
But then i can’t use ajax validation for a form field. I became the follow error in console:
Uncaught TypeError: yii.validation is undefined
But in the rendered html code, the js-files are loaded:
And the the functions are set also in the code:
thanks for tipps