Revision #6 has been created by Kartik V on May 10, 2014, 6:06:49 PM with the memo:
Ajax calls on init.
« previous (#5)
Changes
Title
unchanged
Managing your nested dropdown dependency with DepDrop widget
Category
unchanged
Tutorials
Yii version
unchanged
Tags
unchanged
yii2, dependent, dropdown, select, option, list, select2, widget
Content
changed
[...]
that must contain the preselected value as a key.
3. Set the `depends` property for `subcat` and `prod` as seen below
4. Set the `url` property to an action that will be called to render
the list
5. Set the `initialize` property to `true` for the last child in your nested
list (i.e. `prod` in this case). This will enable plugin to iniyou to tell the plugin
to automati
cal
ize
each dependent dropdown with preselected value in the right order sequentially
for the nested chainly fire the ajax calls on document load and generate the dropdowns
data in the right order sequentially for the nested chain.
6. Alternatively, you can also set the `data` property of each dropdown and not set
the `initialize` property, so that no ajax calls are fired on document load.
```php
use kartik\widgets\DepDrop;
use yii\helpers\Html;[...]