Yii2 And Cjuidialog / Ajax

Hello,

what would be the yii2 way to do this ? :

http://www.yiiframework.com/wiki/72/cjuidialog-and-ajaxsubmitbutton

I have two related tables:




Task                 Category

----                  -----

id                      id

name                category_name

category_id



I want to put a dropdown list in TASK’s _form view, and a button near to be able to create a new category in a modal popup window if needed

Spent quite a while on yii2 docs but can’t find the good info.

Many thanks for any advice on how to start solving this.

Olivier.

simple way… you may create 2 form field

  1. field select for available category

  2. field inputtext for new category

then in controller you may check inputtext if not empty… :)