select2 [ 新手入门 ]
请问有大神用过select2组件实现省市区的关联查询吗?
共 1 条回复
-
$award =$form->field($award_model, 'award_year')->widget(Select2::classname(), [
'data' => $award_model->getAwardList(7615), 'language' => 'zh-cn', 'options' => ['placeholder' =>$award_year], 'pluginOptions' => [ 'allowClear' => true, 'tags' => true, ], 'pluginEvents' => [ 'change' => 'function(){ $.post("'.yii::$app->urlManager->createUrl('video/getaward').'&type=1&parent_award_id="+$(this).val(),function(data){ $("#tag-award_award").html(data); $("#tag-specific_award").html("<option value=>请选择具体的奖项</option>"); })}', ], ]); $award .=$form->field($award_model, 'award_award')->widget(Select2::classname(), [ 'data' =>$award_model->getAwardList($award_year_id), 'language' => 'zh-cn', 'options' => ['placeholder' => $award_award], 'pluginOptions' => [ 'allowClear' => true, 'tags' => true, ], 'pluginEvents' => [ 'change'=>'function(){ $.post("'.yii::$app->urlManager->createUrl('video/getaward').'&type=2&parent_award_id="+$(this).val(),function(data){ $("#tag-specific_award").html(data); });}', ], ]); $award .=$form->field($award_model, 'specific_award')->widget(Select2::classname(), [ 'data' => $award_model->getAwardList($award_award_id), 'language' => 'zh-cn', 'options' => ['placeholder' => $specific_award], 'pluginOptions' => [ 'allowClear' => true, 'tags' => true, ], ]); echo $award;
luoxuan
注册时间:2015-11-26
最后登录:2016-01-07
在线时长:5小时16分
最后登录:2016-01-07
在线时长:5小时16分
- 粉丝0
- 金钱130
- 威望0
- 积分180