当前位置:网站首页>Select trigger event from easyUI drop-down box
Select trigger event from easyUI drop-down box
2022-06-28 05:59:00 【Coder without code】
What I want to do is , First, find out the city name from the database , With json The format is passed to the front end , Front end use input A drop-down box , receive data , And display... In the drop-down box . Be careful , Front end transmission json The data format is fixed , The saved city format is List<map>,map There are two values in , One key by id,value For custom id( from 0 Start to grow ), the other one key by text,value For the name of the city . This is mainly written to correspond to the foreground drop-down box .
The front-end code :
<td> Select the city :
<input type="text" id="city_name" name="city_name" class="easyui-combobox" data-options="editable:true ,valueField: 'id',textField: 'text',url:'${pageContext.request.contextPath}/admin/main/getcity',prompt: ' The city name ',validType:'length[0,100]' "/>
</td> Then you need to get the click event . $(function(){
$("#city_name").combobox({
onSelect:function(record){
var cit=$("#city_name").combobox('getText');
$.ajax({
type:"POST",
url:'${pageContext.request.contextPath}/admin/main/getCityst',
dataType:"json",
data:{
"city":cit
},
success:function(json){
$("#version").text(json.version);
$("#lianjie").text(json.cstatus);
$("#qiantai").text(json.qstatus);
$("#xyzsl").text(json.alls);
$("#wljsl").text(json.noda);
}
})
}
}) according to id Get dropdown , then onSelect Get the selected drop-down box column , Then you can get the selected city . according to id, Use combobox,getText Get the city name , Then execute the front desk according to the name of the city ajax, Get other data under the city . 边栏推荐
猜你喜欢

Lenovo hybrid cloud Lenovo xcloud, new enterprise IT service portal

Working principle of es9023 audio decoding chip

At first glance, I can see several methods used by motionlayout

lombok @EqualsAndHashCode 注解如何让对象.equals()方法只比较部分属性

Example of MVVM framework based on kotlin+jetpack

socke.io長連接實現推送、版本控制、實時活躍用戶量統計

Apple MDM Bypass 免越狱绕过MDM配置锁 免费

YYGH-6-微信登录

What are the advantages of e-mail marketing? Why do sellers of shopline independent station attach so much importance to it?

How popular are FB and WhatsApp mass messages in 2022?
随机推荐
Yygh-8-appointment registration
lombok @EqualsAndHashCode 注解如何让对象.equals()方法只比较部分属性
windows上安装redis并永久修改密码,及ssm框架集成redis
Data warehouse: detailed explanation of hierarchical design
Data warehouse: financial / banking theme layer division scheme
5GgNB和ng-eNB的主要功能
Xcode13.3.1 项目执行pod install后报错
Ethereum Classic的难度计算|猿创征文
Flink 窗口机制 (两次等待, 最后兜底)
UICollectionViewDiffableDataSource及NSDiffableDataSourceSnapshot使用介绍
Drop down box for implementation
OpenSCAP 简介
预训练模型参数不匹配
Sharing tips for efficient scripting
Cryptography notes
death_satan/hyperf-validate
MR-WordCount
qtcanpool 知 07:Ribbon
Global country (and region) information JSON data
函数栈帧的创建和销毁