html
<select name="gridding" id="gridding" lay-filter="gridding">
<option value="">请选择网格</option>
</select>
js
form.on('select(village)', function(data) {
var seone = data.value;
$.ajax({
url: $url+"/jxkh/S0008F0006_2",
type: "post",
dataType: "json",
data: {
csq: seone
},
success: function(data) {
if (data.result == 200) {
$("#gridding").empty();
$("#gridding").append(new Option("请选择网格", ""));
$.each(data.data, function(index, item) {
$('#gridding').append(new Option(item));
});
} else {
$("#gridding").append(new Option("暂无数据", ""));
}
layui.form.render("select");
}
})
})
网友评论