<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ## 多級聯動 * https://github.com/kartik-v/dependent-dropdown * 在view文件form中 ~~~ <?php echo $form->field($model, 'brand_id') ->dropDownList(\yii\helpers\ArrayHelper::map( \common\models\WxBrand::find() ->where(['client_id' => $gh->client_id])->orderBy('sort_order desc')->all(), 'id', 'name' ), ['prompt'=>'選擇品牌...', 'id'=>'brand_id'])->label('品牌'); ?> <?php echo $form->field($model, 'model_id')->label('型號') ->widget(\kartik\depdrop\DepDrop::classname(), [ 'options' => ['id' => 'model_id', 'class'=>'', 'style'=>''], 'pluginOptions'=>[ 'depends'=>['brand_id'], 'placeholder' => '機型...', 'initialize' => $model->isNewRecord ? false : true, 'url' => Url::to(['/sj-policy/model-subcat']), ] ]); ?> ~~~ * 在controll中, 當下拉框change時對應的動作, 注意返回的json(字段必須是'id', 'name') ~~~ [ 0 => ['id' => 1, 'name' => 'SONY-1'], 1 => ['id' => 2, 'name' => 'SONY-2'], ... ] public function actionModelSubcat() { $out = []; if (isset($_POST['depdrop_parents'])) { $parents = $_POST['depdrop_parents']; if ($parents != null) { $parent_id = $parents[0]; //$out = \common\models\SjPhoneModel::find()->select(['id', 'name']) ->where(['brand_id' => $parent_id])->orderBy(['sort_order' => SORT_DESC])->asArray()->all(); $out = \common\models\SjPhoneModel::find()->select(['id', 'title as name']) ->where(['brand_id' => $parent_id])->orderBy(['sort_order' => SORT_DESC])->asArray()->all(); return \yii\helpers\Json::encode(['output'=>$out, 'selected'=>empty($out) ? '' : $out[0]['id']]); } } return \yii\helpers\Json::encode(['output'=>'', 'selected'=>'']); } ~~~
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看