Managing your nested dropdown dependency with DepDrop widget

Comparing #5 with #6

Revision #6 was created by Kartik V Kartik V on May 10, 2014, 6:06:49 PM.

Ajax calls on init.

Content

[...]
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;
[...]