首页 > 其他 > 详细

二级联动(list对象中存list对象)

时间:2018-10-16 10:38:18      阅读:192      评论:0      收藏:0      [点我收藏+]


var platformListJson = ‘${platformListJson}‘;
var shopPlatformHtml=‘‘;
$(JSON.parse(platformListJson)).each(function (i, o) {
shopPlatformHtml+=‘<option value="‘+o.code+‘" shopList=‘+JSON.stringify(o.shopList)+‘>‘+o.name+‘</option>‘;
});
$(‘#shopPlatform‘).html(shopPlatformHtml).change(function(){
var shopList=JSON.parse($(this).find(‘option:selected‘).attr(‘shopList‘));
var shopCodeHtml=‘‘;
$(shopList).each(function(i,o){
shopCodeHtml+=‘<option value="‘+o.shopId+‘">‘+o.shopName+‘</option>‘;
});
$(‘#shopCode‘).html(shopCodeHtml);
}).change();

二级联动(list对象中存list对象)

原文:https://www.cnblogs.com/chenxiaoxian/p/9796520.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!