Skip to content

fix TypeError: yiiActiveFormData is undefined#274

Open
HZ-labs wants to merge 1 commit intowbraganca:masterfrom
HZ-labs:patch-1
Open

fix TypeError: yiiActiveFormData is undefined#274
HZ-labs wants to merge 1 commit intowbraganca:masterfrom
HZ-labs:patch-1

Conversation

@HZ-labs
Copy link
Copy Markdown

@HZ-labs HZ-labs commented Jan 18, 2019

yiiActiveForm is not so fast sometimes, you have run yiiDynamicForm only then yiiActiveForm is completed

`yiiActiveForm` is not so fast sometimes, needed run `yiiDynamicForm` only after `yiiActiveForm` is completed
@malchikovma
Copy link
Copy Markdown

My form submit listener ($('#file-form').on('beforeSubmit', function () {...}) didn't work because of this so i had to override whole file. Whole because some properties were private and I couldn't access them even through inheritance and I didn't want to make a fork.

mirkocapraraelite added a commit to mirkocapraraelite/yii2-dynamicform that referenced this pull request Sep 1, 2020
StitchUA added a commit to StitchUA/yii2-dynamicform that referenced this pull request Aug 16, 2021
@kwazaro
Copy link
Copy Markdown

kwazaro commented Sep 16, 2021

So, how to fix it??

@malchikovma
Copy link
Copy Markdown

So, how to fix it??

Either try the fork of StitchUA or override asset file of wbraganca like that, using changes from aaaa56d.

@kwazaro
Copy link
Copy Markdown

kwazaro commented Sep 16, 2021

 $js = 'jQuery("#' . $this->formId . '").yiiDynamicForm(' . $this->_hashVar .');' . "\n";
        $view->registerJs($js, $view::POS_LOAD);

This code runs inline script before the ActiveFormAsset is really loaded. I don't know how to deal with it...

@kwazaro
Copy link
Copy Markdown

kwazaro commented Sep 16, 2021

What should I change in composer.json, to use FORK?

anovsiradj added a commit to anovsiradj/yii2-dynamicform that referenced this pull request Oct 22, 2021
wait until `document.ready` not `window.load`.
<wbraganca#274>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants