Skip to content

Commit

Permalink
Bug wbraganca#274: fix TypeError: yiiActiveFormData is undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
mirkocapraraelite committed Sep 1, 2020
1 parent bebb469 commit c179d71
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/DynamicFormWidget.php
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,10 @@ public function registerAssets($view)
$js .= "});\n";
$view->registerJs($js, $view::POS_READY);

$js = 'jQuery("#' . $this->formId . '").yiiDynamicForm(' . $this->_hashVar .');' . "\n";
$view->registerJs($js, $view::POS_LOAD);
$js = 'jQuery("#' . $this->formId . '").on("afterInit", function(e) {' . "\n";
$js .= ' jQuery("#' . $this->formId . '").yiiDynamicForm(' . $this->_hashVar .');' . "\n";
$js .= "});\n";
$view->registerJs($js, $view::POS_READY);
}

/**
Expand Down

0 comments on commit c179d71

Please sign in to comment.