JQuery Easyui/TopJUI 创建多级联动下拉框(纯HTML实现!!!)

效果展示:

代码如下:

<form data-toggle="topjui-form">
<div class="topjui-container">
<fieldset>
<legend>调用本地数据</legend>
</fieldset> <div class="topjui-row">
<div class="topjui-col-sm6">
<label class="topjui-form-label">性别</label>
<div class="topjui-input-block">
<input type="text" name="sex"
data-toggle="topjui-combobox"
data-options="data:[{value:1,text:'男'},{value:2,text:'女'}]">
</div>
</div>
<div class="topjui-col-sm6">
<label class="topjui-form-label">学历(必填)</label>
<div class="topjui-input-block">
<input type="text" name="degree"
data-toggle="topjui-combobox"
data-options="required:true,
valueField:'id',
textField:'text',
data:[{id:1,text:'大专'},{id:2,text:'本科'},{id:3,text:'研究生'},{id:4,text:'博士生'}]">
</div>
</div>
</div>
<div class="topjui-row">
<div class="topjui-col-sm6">
<label class="topjui-form-label">渲染下拉项</label>
<div class="topjui-input-block">
<input type="text" name="degree"
data-toggle="topjui-combobox"
data-options="required:true,
prompt:'使用formatter属性渲染下拉项',
valueField:'id',
textField:'text',
formatter:formatter,
data:[{id:2,text:'本科-某大学'},{id:3,text:'研究生-某大学'},{id:4,text:'博士生-某大学'}]">
</div>
</div>
</div> <fieldset>
<legend>调用远程数据</legend>
</fieldset>
<div class="topjui-row">
<div class="topjui-col-sm6">
<label class="topjui-form-label">籍贯</label>
<div class="topjui-input-block">
<input type="text" name="nativePlace"
data-toggle="topjui-combobox"
data-options="panelHeight:250,
valueField:'id',
url:_ctx + '/json/combobox/nativePlace.json'">
</div>
</div>
<div class="topjui-col-sm6">
<label class="topjui-form-label">民族(必填)</label>
<div class="topjui-input-block">
<input type="text" name="nation"
data-toggle="topjui-combobox"
data-options="required:true,
prompt:'必填',
panelHeight:250,
valueField:'id',
url:_ctx + '/json/combobox/nation.json'">
</div>
</div>
</div> <fieldset>
<legend>多级联动下拉框(主动级联,上级触发下级)</legend>
</fieldset> <div class="topjui-row">
<div class="topjui-col-sm6">
<label class="topjui-form-label">国家</label>
<div class="topjui-input-block">
<input type="text" name="country"
data-toggle="topjui-combobox"
data-options="panelHeight:250,
url:_ctx + '/json/combobox/country.json',
valueField: 'id',
childCombobox:{
id:'province',
url:remoteHost+'/system/codeItem/getListByPid?pid={parentValue}'
}">
</div>
</div>
<div class="topjui-col-sm6">
<label class="topjui-form-label">省份</label>
<div class="topjui-input-block">
<input type="text" name="province"
data-toggle="topjui-combobox"
data-options="id:'province',
panelHeight:250,
valueField: 'id',
childCombobox:{
id:'city',
url:remoteHost+'/system/codeItem/getListByPid?pid={parentValue}'
}">
</div>
</div>
</div> <div class="topjui-row">
<div class="topjui-col-sm6">
<label class="topjui-form-label">城市</label>
<div class="topjui-input-block">
<input type="text" name="city"
data-toggle="topjui-combobox"
data-options="id:'city',
panelHeight:250,
valueField: 'id',
childCombobox:{
id:'district',
url:remoteHost+'/system/codeItem/getListByPid?pid={parentValue}'
}">
</div>
</div>
<div class="topjui-col-sm6">
<label class="topjui-form-label">区县</label>
<div class="topjui-input-block">
<input type="text" name="district"
data-toggle="topjui-combobox"
data-options="id:'district',
panelHeight:250,
valueField: 'id'">
</div>
</div>
</div> <fieldset>
<legend>多级联动下拉框(被动级联,下级获取上级)</legend>
</fieldset> <div class="topjui-row">
<div class="topjui-col-sm6">
<label class="topjui-form-label">国家</label>
<div class="topjui-input-block">
<input type="text" name="country2"
data-toggle="topjui-combobox"
data-options="panelHeight:250,
valueField: 'id',
url:_ctx + '/json/combobox/country.json'">
</div>
</div>
<div class="topjui-col-sm6">
<label class="topjui-form-label">省份</label>
<div class="topjui-input-block">
<input type="text" name="province2"
data-toggle="topjui-combobox"
data-options="id:'province2',
panelHeight:250,
valueField: 'id',
url:remoteHost+'/system/codeItem/getListByPid?pid={country2}'">
</div>
</div>
</div> <div class="topjui-row">
<div class="topjui-col-sm6">
<label class="topjui-form-label">城市</label>
<div class="topjui-input-block">
<input type="text"
name="city2"
data-toggle="topjui-combobox"
data-options="id:'city2',
panelHeight:250,
valueField: 'id',
url:remoteHost+'/system/codeItem/getListByPid?pid={province2}'">
</div>
</div>
<div class="topjui-col-sm6">
<label class="topjui-form-label">区县</label>
<div class="topjui-input-block">
<input type="text"
name="district2"
data-toggle="topjui-combobox"
data-options="id:'district2',
panelHeight:250,
valueField: 'id',
url:remoteHost+'/system/codeItem/getListByPid?pid={city2}'">
</div> </div>
</div>
</div>
</form>

  

EasyUI中文网:http://www.jeasyui.cn

TopJUI前端框架:http://www.topjui.com

TopJUI交流社区:http://ask.topjui.com

JQuery Easyui/TopJUI 创建多级联动下拉框(纯HTML实现!!!)的更多相关文章

  1. jQuery EasyUI/TopJUI创建树形表格下拉框

    jQuery EasyUI/TopJUI创建树形表格下拉框 第一种方法(纯HTML创建) <div class="topjui-row"> <div class= ...

  2. 第二百二十四节,jQuery EasyUI,ComboGrid(数据表格下拉框)组件

    jQuery EasyUI,ComboGrid(数据表格下拉框)组件 学习要点: 1.加载方式 2.属性列表 3.方法列表 本节课重点了解 EasyUI 中 ComboGrid(数据表格下拉框)组件的 ...

  3. 第二百二十七节,jQuery EasyUI,ComboTree(树型下拉框)组件

    jQuery EasyUI,ComboTree(树型下拉框)组件 学习要点: 1.加载方式 2.属性列表 3.方法列表 本节课重点了解EasyUI中ComboTree(树型下拉框)组件的使用方法,这个 ...

  4. ajax 多级联动 下拉框 Demo

    写了ajax实现级联下拉框,考虑常用,并且级联个数随不同业务个数不同,于是就整理了一下,实现了 ajax + N级联动 下拉框的效果 效果图 HTML 代码 <h2> 省级联动</h ...

  5. bootstrap 多级联动下拉框

    <!DOCTYPE HTML> <html lang="zh-CN"> <head> <meta charset="UTF-8& ...

  6. jQuery cxSelect 多级联动下拉菜单

    随着电商热门,这种多层次的互动更充分地体现在下拉菜单,最明显的是多级联动地址下拉选择,因此,这里是一个简单的分享 jQuery cxSelect 多级联动下拉菜单 cxSelect 它是基于 jQue ...

  7. jquery+html三级联动下拉框

    jquery+html三级联动下拉框及详情页面加载时的select初始化问题   html写的三个下拉框,如下: <select name="ddlQYWZYJ" id=&q ...

  8. jquery+ligerform三级联动下拉框

    如下为ligerform里的三级联动下拉框: var formData=[ {display:,width:,space:,type:"select",group:"区域 ...

  9. jQuery实现的3个基础案例(仿QQ列表分组,二级联动下拉框,模拟员工信息管理系统)

    1.仿QQ列表分组 <!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type&quo ...

随机推荐

  1. SQLSERVER安装记录

    很多人都喜欢重装编程环境,VS,SQL是最常见的 尤其是SQL,在删除所有的SQL相关的组件之后(360),记得再次打开控制面板,查看是否有漏掉的,本人就有一个SQLXML没有删除掉 在删除之后,清理 ...

  2. vi编辑器使用方法(最详细)

    vi编辑器是所有Unix及Linux系统下标准的编辑器,它的强大不逊色于任何最新的文本编辑器,这里只是简单地介绍一下它的用法和一小部分指令.由于对Unix及Linux系统的任何版本,vi编辑器是完全相 ...

  3. js中得~~是什么意思/JS按位非(~)运算符与~~运算符的理解分析

    其实是一种利用符号进行的类型转换,转换成数字类型 ~~true == 1 ~~false == 0 ~~"" == 0 ~~[] == 0 ~~undefined ==0 ~~!u ...

  4. python把源代码打包成.exe文件

    1.在windows命令行把当前文件夹用cd命令切换到源代码所在文件夹. 2.输入命令:pyinstaller -w -F main.py

  5. 使用C语言解析URL

    1. [代码]容易写成自己输入URL,这里测试一个例子     #include <stdio.h>#include <stdlib.h>#include <string ...

  6. html 转字符串换成代码

    1. [文件] htmlToCode.html <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" ...

  7. 30个Jquery灯箱插件

    jQuery 是非常流行的JS框架,其俨然已成了开发者的必备工具,其中的jQuery Lightbox插件更是为广大开发者所喜爱.它惊人的特征之一是jQuery Lightbox插件有很多变化. 下面 ...

  8. Linux_异常_01_CentOS7无法ping 百度

    一.原因 vi /etc/sysconfig/network-scripts/ifcfg-ens33 TYPE=Ethernet PROXY_METHOD=none BROWSER_ONLY=no B ...

  9. L87

    Fear Makes Art More Engaging Emmanuel Kant spoke often about the sublime, and specifically how art b ...

  10. EMQ开启mysql认证

    规定通过mqtt_user表格验证过的用户才能连接EMQ服务器,我们需要开启mysql插件认证.EMQ2.0自带mysql插件,下面开始配置. 新建mqtt_user表格 要想控制用户登录EMQ,肯定 ...