zxbodya / yii2-gallery-manager

93 stars 61 forks source link

Use gallery-manager widget in bootstrap modal window #59

Open ArCoLab opened 6 years ago

ArCoLab commented 6 years ago

I use renderAjax to load form in modal window. Gallery widget render view (buttons etc..) but not works (don't upload files). It working OK without modal... Please help.

Controller:

public function actionAddAnnounce(){ $announce = new Announces(); return $this->renderAjax('add_announce', compact('announce')); }

View (add_announce)

$form = ActiveForm::begin(['action' => '/user/add-announce', 'id' => 'new_announce']); echo GalleryManager::widget( [ 'model' => $announce, 'behaviorName' => 'galleryBehavior', 'apiRoute' => 'user/galleryApi' ]); ActiveForm::end();

ArCoLab commented 6 years ago

Just need to add id of ActiveForm parameter in widget...