I have four dependent drop downs of hierarchy `library > catalog > category > subject`

I am using `kartik depdrop`, every thing is working really fine but on update I couldn't find any solution for pre selected values. 
What I need is to show pre selected values on update with all other values as well so that user can change the selection also.

Here is my code.

\_form.php

```
<div class="inner-addon right-addon">
        <div class="catalog-input">
            <span><strong>Library</strong></span>
            <?php echo $form->field($modelDep, 'lesson_name[0]')->dropDownList($libList, [
                'prompt' => 'Select Library',
                'id'=>'lib-id-1',
                'name'=>'Lesson[library]'
            ])->label(false); ?>
        </div> 
        <div class="category-input">
            <span><strong>Catalog</strong></span>
            <?php
            echo $form->field($modelDep, 'lesson_name[1]')->widget(DepDrop::classname(), [  
                'options'=>['id'=>'catalog-id-1', 'name'=>'Lesson[catalog]'],
                'pluginOptions'=>[
                    'depends'=>['lib-id-1'],
                    'placeholder'=>'Select Catalog',
                    'url'=>Url::to(['/lesson/catalog'])
                ]
            ])->label(false);
            ?>
        </div> 
        <div class="subject-input">
            <span><strong>Category</strong></span>
            <?php
                echo $form->field($modelDep, 'lesson_name[2]')->widget(DepDrop::classname(), [
                    'options'=>['id'=>'cat-id-1', 'name'=>'Lesson[category]'],
                    'pluginOptions'=>[
                        'depends'=>['catalog-id-1'],
                        'placeholder'=>'Select Category',
                        'url'=>Url::to(['/lesson/category'])
                    ]
                ])->label(false);
            ?>
        </div> 
        <div class="topic-input">
            <span><strong>Subject</strong></span>
            <?php
                echo $form->field($modelDep, 'lesson_name[3]')->widget(DepDrop::classname(), [
                    'options'=>['id'=>'subject-id-1', 'name'=>'Lesson[fk_subject]'],
                    'pluginOptions'=>[
                        'depends'=>['cat-id-1'],
                        'placeholder'=>'Select Subject',
                        'url'=>Url::to(['/lesson/subject'])
                    ]
                ])->label(false);
            ?>
        </div> 
    </div>

```

Controller

```
public function actionCatalog() {
    $out = [];
    if (isset($_POST['depdrop_parents'])) {
        $parents = $_POST['depdrop_parents'];
        if ($parents != null) {
            $lib_id = $parents[0];
            $out = $this::getCatalogList($lib_id);
            echo Json::encode(['output'=>$out, 'selected'=>'']);
            return;
        }
    }
    echo Json::encode(['output'=>'', 'selected'=>'']);
}
public static function getCatalogList($lib_id){
    $company_name = array_shift((explode(".", $_SERVER['HTTP_HOST'])));
    $company = \common\models\Company::find()->where(['company_name' => $company_name])->one();
    $data= \common\models\Catalog::find()
       ->where(['fk_library'=>$lib_id,'fk_company'=>$company->id])
       ->select(['id','catalog_name AS name' ])->asArray()->all();
    return $data;
}

public function actionCategory() {
    $out = [];
    if (isset($_POST['depdrop_parents'])) {
            $parents = $_POST['depdrop_parents'];
            if ($parents != null) {
                $cat_id = $parents[0];
                $out = $this::getCategoryList($cat_id);
                echo Json::encode(['output'=>$out, 'selected'=>'']);
                return;
            }
        }
    echo Json::encode(['output'=>'', 'selected'=>'']);
}
public static function getCategoryList($cat_id){
    $company_name = array_shift((explode(".", $_SERVER['HTTP_HOST'])));
    $company = \common\models\Company::find()->where(['company_name' => $company_name])->one();
    $data= \common\models\Category::find()
       ->where(['fk_catalog'=>$cat_id,'fk_company'=>$company->id])
       ->select(['id','category_name AS name' ])->asArray()->all();
    return $data;
}

public function actionSubject() {
    $out = [];
    if (isset($_POST['depdrop_parents'])) {
            $parents = $_POST['depdrop_parents'];
            if ($parents != null) {
                $category_id = $parents[0];
                $out = $this::getSubjectList($category_id);
                echo Json::encode(['output'=>$out, 'selected'=>'']);
                return;
            }
        }
    echo Json::encode(['output'=>'', 'selected'=>'']);
}
public static function getSubjectList($category_id){
    $company_name = array_shift((explode(".", $_SERVER['HTTP_HOST'])));
    $company = \common\models\Company::find()->where(['company_name' => $company_name])->one();
    $data= \common\models\Subject::find()
       ->where(['fk_category'=>$category_id,'fk_company'=>$company->id])
       ->select(['id','subject_name AS name' ])->asArray()->all();
    return $data;
}

```