Difference between #5 and #6 of
Managing your nested dropdown dependency with DepDrop widget

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 automa
ticalize 
 
   each dependent dropdown with preselected value in the right order sequentially 
 
   for the nested chain
ly 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;
[...]
2 3
42 followers
Viewed: 89 279 times
Version: 2.0
Category: Tutorials
Written by: Kartik V
Last updated by: Kartik V
Created on: May 8, 2014
Last updated: 10 years ago
Update Article

Revisions

View all history