添加购物车的需求,需要做成美团外卖点菜联动ListView的效果
2022-05-17 09:20:43 59KB 购物车 二级联动 点单
1
主要介绍了使用javascript中读取Xml文件做成的一个二级联动菜单,需要的朋友可以参考下
2022-05-16 22:40:39 37KB javascript 读取Xml 二级联动菜单
1
商品类别二级联动下拉列表,简单易懂,代码基本上都注释了,懂javascript就能看懂并修改为己所用。必选+非必选
2022-05-14 10:34:21 4KB 二级联动下拉列表 商品类别
1
我是一个android新手,所以一切以简单起步。android的控件spinner,类似于一个下拉列表.如果您正在学习这个控件,需要实现基于这个控件的二级联动效果,不妨使用这个看看. 使用方法:用eclipse导入,假若报错,把平台改为android2.2,jdk1.6就可以了。
2022-05-05 12:15:51 44KB android spinner 省市二级联动 源码
1
spProvince = (Spinner)findViewById(R.id.spAddMettingAddressProvince); spCity = (Spinner)findViewById(R.id.spAddMettingAddressCity); ArrayAdapter aAdapter = ArrayAdapter.createFromResource(this, R.array.province, android.R.layout.simple_spinner_item); aAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); spProvince.setAdapter(aAdapter); spProvince.setOnItemSelectedListener(new OnItemSelectedListener() { @Override public void onItemSelected(AdapterView parent, View view, int position, long id) { Spinner spinner = (Spinner)parent; String pro = (String)spinner.getItemAtPosition(position); ArrayAdapter cityAdapter = ArrayAdapter.createFromResource (MettingAddActivity.this, R.array.city_default, android.R.layout.simple_spinner_item); //new ArrayAdapter // (MainActivity.this,android.R.layout.simple_spinner_item, cities); //获取所在省含有哪些市(从资源数组文件中获取数据) if(pro.equals("河北省")){ cityAdapter = ArrayAdapter.createFromResource (MettingAddActivity.this, R.array.hebei, android.R.layout.simple_spinner_item); }else if(pro.equals("北京市")){ cityAdapter = ArrayAdapter.createFromResource (MettingAddActivity.this, R.array.bj, android.R.layout.simple_spinner_item); }else if(pro.equals("山西省")){ cityAdapter = ArrayAdapter.createFromResource (MettingAddActivity.this, R.array.shan1xi, android.R.layout.simple_spinner_item); }else if(pro.equals("天津市")){ cityAdapter = ArrayAdapter.createFromResource (MettingAddActivity.this, R.array.tianjing, android.R.layout.simple_spinner_item); }else if(pro.equals("内蒙古")){ cityAdapter = ArrayAdapter.createFromResource (MettingAddActivity.this, R.array.neimeng, android.R.layout.simple_spinner_item); }else if(pro.equals("辽宁省")){ cityAdapter = ArrayAdapter.createFromResource (MettingAddActivity.this, R.array.liaoning, android.R.layout.simple_spinner_item); }else if(pro.equals("吉林省")){ cityAdapter = ArrayAdapter.createFromResource (MettingAddActivity.this, R.array.jilin, android.R.layout.simple_spinner_item); }else if(pro.equals("黑龙江省")){ cityAdapter = ArrayAdapter.createFromResource (MettingAddActivity.this, R.array.heilongjjiang, android.R.layout.simple_spinner_item); }else if(pro.equals("上海市")){ cityAdapter = ArrayAdapter.createFromResource (MettingAddActivity.this, R.array.shanghai, android.R.layout.simple_spinner_item); }else if(pro.equals("江苏省")){ cityAdapter = ArrayAdapter.createFromResource (MettingAddActivity.this, R.array.jiangsu, android.R.layout.simple_spinner_item); }else if(pro.equals("浙江省")){ cityAdapter = ArrayAdapter.createFromResource (MettingAddActivity.this, R.array.zhejiang, android.R.layout.simple_spinner_item); }else if(pro.equals("安徽省")){ cityAdapter = ArrayAdapter.createFromResource (MettingAddActivity.this, R.array.anhui, android.R.layout.simple_spinner_item); }else if(pro.equals("福建省")){ cityAdapter = ArrayAdapter.createFromResource (MettingAddActivity.this, R.array.fujian, android.R.layout.simple_spinner_item); }else if(pro.equals("江西省")){ cityAdapter = ArrayAdapter.createFromResource (MettingAddActivity.this, R.array.jiangxi, android.R.layout.simple_spinner_item); }else if(pro.equals("山东省")){ cityAdapter = ArrayAdapter.createFromResource (MettingAddActivity.this, R.array.shandong, android.R.layout.simple_spinner_item); }else if(pro.equals("河南省")){ cityAdapter = ArrayAdapter.createFromResource (MettingAddActivity.this, R.array.henan, android.R.layout.simple_spinner_item); }else if(pro.equals("湖北省")){ cityAdapter = ArrayAdapter.createFromResource (MettingAddActivity.this, R.array.hubei, android.R.layout.simple_spinner_item); }else if(pro.equals("湖南省")){ cityAdapter = ArrayAdapter.createFromResource (MettingAddActivity.this, R.array.hunan, android.R.layout.simple_spinner_item); }else if(pro.equals("广东省")){ cityAdapter = ArrayAdapter.createFromResource (MettingAddActivity.this, R.array.guangdong, android.R.layout.simple_spinner_item); }else if(pro.equals("广西自治区")){ cityAdapter = ArrayAdapter.createFromResource (MettingAddActivity.this, R.array.guangxi, android.R.layout.simple_spinner_item); }else if(pro.equals("海南省")){ cityAdapter = ArrayAdapter.createFromResource (MettingAddActivity.this, R.array.hainan, android.R.layout.simple_spinner_item); }else if(pro.equals("重庆市")){ cityAdapter = ArrayAdapter.createFromResource (MettingAddActivity.this, R.array.chongqing, android.R.layout.simple_spinner_item); }else if(pro.equals("四川省")){ cityAdapter = ArrayAdapter.createFromResource (MettingAddActivity.this, R.array.sichuan, android.R.layout.simple_spinner_item); }else if(pro.equals("贵州省")){ cityAdapter = ArrayAdapter.createFromResource (MettingAddActivity.this, R.array.guzhou, android.R.layout.simple_spinner_item); }else if(pro.equals("云南省")){ cityAdapter = ArrayAdapter.createFromResource (MettingAddActivity.this, R.array.yunan, android.R.layout.simple_spinner_item); }else if(pro.equals("西藏自治区")){ cityAdapter = ArrayAdapter.createFromResource (MettingAddActivity.this, R.array.xizang, android.R.layout.simple_spinner_item); }else if(pro.equals("陕西省")){ cityAdapter = ArrayAdapter.createFromResource (MettingAddActivity.this, R.array.shan3xi, android.R.layout.simple_spinner_item); }else if(pro.equals("甘肃省")){ cityAdapter = ArrayAdapter.createFromResource (MettingAddActivity.this, R.array.gansu, android.R.layout.simple_spinner_item); }else if(pro.equals("青海省")){ cityAdapter = ArrayAdapter.createFromResource (MettingAddActivity.this, R.array.qinghai, android.R.layout.simple_spinner_item); }else if(pro.equals("宁夏回族自治区")){ cityAdapter = ArrayAdapter.createFromResource (MettingAddActivity.this, R.array.ningxia, android.R.layout.simple_spinner_item); }else if(pro.equals("新疆维吾尔自治区")){ cityAdapter = ArrayAdapter.createFromResource (MettingAddActivity.this, R.array.xinjiang, android.R.layout.simple_spinner_item); }else if(pro.equals("香港特别行政区")){ cityAdapter = ArrayAdapter.createFromResource (MettingAddActivity.this, R.array.xianggang, android.R.layout.simple_spinner_item); }else if(pro.equals("澳门特别行政区")){ cityAdapter = ArrayAdapter.createFromResource (MettingAddActivity.this, R.array.aomen, android.R.layout.simple_spinner_item); }else if(pro.equals("台湾省")){ cityAdapter = ArrayAdapter.createFromResource (MettingAddActivity.this, R.array.taiwan, android.R.layout.simple_spinner_item); } cityAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); //绑定数据到Spinner(City)上 spCity.setAdapter(cityAdapter); } @Override public void onNothingSelected(AdapterView parent) { } });
2022-05-05 11:15:21 14KB android spinner 省市二级联动
1
一个超级超级简单的一个HTML二级联动,仅供分享
2022-04-25 22:51:40 2KB 二级联动 HTML JavaScript
1
先看一下简单的效果 直接上代码 html部分 (下拉框中value的数值我是根据数据库中取出来)
<select name=city lay-filter=province>
2022-04-22 15:11:31 117KB jq jquery lay
1
JQuery实现动态绑定DropDownList和二级联动
2022-03-21 10:20:54 1.2MB 联动JQuery
1
最简单的二级联动源码下载,可以直接使用。
2022-01-21 17:20:19 2KB 二级联动
1
小程序picker 二级联动。需要的拿走,只为减少弯路。js文件中为了更方便看到效果所以直接把json 贴出来,通过 JSON.parse(json) 转成对象。正常的应该是通过接口返回的,各位做成动态的要把这个代码去掉,拼装成这样就好了。亲测,可用。 wxml中默认的显示的 两个分类名称,第一个给注释掉了,看需求可再修改显示一个分类名称,还是两个分类名称。 20200603修改了个bug。这个方法重写了 bindMultiPickerColumnChange: function (e) { var that=this; console.log('修改的列为', e.detail.column, ',值为', e.detail.value); var data = { multiArray: this.data.multiArray, multiIndex: this.data.multiIndex }; data.multiIndex[e.detail.column] = e.detail.value; //如果是第0列,那麼第1列则显示 if(e.detail.column == 0) { for (let i = 0; i < that.data.allmultiArray[e.detail.value].child.length; i++) { if (i == 0) { that.setData({ 'childcatid': that.data.allmultiArray[e.detail.value].child[i].class_id, "multiArray[1]":[] }); } that.data.multiArray[1].push(that.data.allmultiArray[e.detail.value].child[i].class_name); } } //如果是第1列 if(e.detail.column == 1) { for (let i = 0; i < that.data.allmultiArray[that.data.multiIndex[0]].child.length; i++) { if (i == e.detail.column) { that.setData({ 'childcatid': that.data.allmultiArray[that.data.multiIndex[0]].child[i].class_id }); } } } this.setData(data); },
1