// 遍历select 回显客户名称
$("#cus_id").each(function() {
// this代表的是<option></option>,对option再进行遍历
$(this).children("option").each(function() {
// 判断需要对那个选项进行回显
console.log("this.innertext, cus_id", this.innerText, store_obj["cus_id"])
if (this.innerText == store_obj["cus_id"]) {
console.log($(this).text());
// 进行回显
$(this).attr("selected","selected");
}
});
form.render('select');
})
// 遍历select 回显平台名称
$("#plat_id").each(function() {
// this代表的是<option></option>,对option再进行遍历
$(this).children("option").each(function() {
// 判断需要对那个选项进行回显
if (this.innerText == store_obj["store_no"]) {
console.log($(this).text());
// 进行回显
$(this).attr("selected","selected");
}
});
form.render('select');
})
layui 下拉框回显默认值
最新推荐文章于 2024-06-28 15:08:59 发布