2.5 二级联动下拉

页面效果:

QQ图片20190827115330.png

html代码:

QQ图片20190827115343.png

js代码:

#define layuiFunc()
     form.on('select(myselect)', function(data){
      var themeId=data.value;
      $.ajax({
            type: 'POST',
            url: '#(path)/portal/golf/station/queryBythemeId?isJson=true',
            data: {'themeId':themeId},
            dataType:  'json',
            success: function(data){
                $("#station_id").html("");
                var option=$("<option>").val("").text("赛事分站");
                $("#station_id").append(option);
                form.render('select');
                $.each(data, function(key, val) {
                	var option1 = $("<option>").val(val.id).text(val.stationName);
                           $("#station_id").append(option1);
                           form.render('select');
                  }); 
               $("#station_id").get(0).selectedIndex=0;
           }
    	}); 
   }); 

#end


顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友
扫描二维码加琴海森林为好友