Closed delikates-nsk closed 1 year ago
you can refer this: https://www.yiiframework.com/forum/index.php/topic/69942-solved-pjax-in-remote-modal-cause-multiple-request/ but I think it's not the best way
This is the first thing I tried. Unfortunately it did not help me
if there have nesting relation about pjax ? refer this option: skipOuterContainers
Closing since it was more of a support question.
Sorry for broken english. I have modal window. Inside him pjax-container and form loading by ajax request every time when i'mopen the window.
Submitting form, closing modal window. Open modal-window again and try submit. Inside browser "developer tools" on tab "Network" i'm see 2 submit requests. Close window. Open. Submit. See 3 (!) submit requests... and more.. and more...
On close window event i'm bind next .js-function
After open and closing window i see inside browser "developer tools" on tab "Inspector" form and form's submit events. I found 2 events - from Yii and pjax. After closing window - event by Yii is deleted, but event from pjax not deleted. And after open window again i'm see 3(!) submit events, 1 from Yii and 2(!) same events from pjax. If i'm close window and open again - i'm see 3(!) same events on submit form by pjax.
I do not understand why this happens but I found a solution.
1st - inside widgets\Pjax.php change string
to
2nd - On close window event i'm bind next .js-function
I hope this will somehow help the author to solve this problem