当前位置:网站首页>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 . 边栏推荐
- Qtcanpool knowledge 07:ribbon
- Sklearn Feature Engineering (summary)
- Comparison between relational database and document database
- Jenkins continuous integration 1
- ThreadLocal
- Relevant implementation records of CSI and local disk
- 原动力×云原生正发声 降本增效大讲堂
- 猿粉猿动力-开发者活动袭!
- How to add live chat in your Shopify store?
- cocoapod中的第三方库怎么引用本地头文件
猜你喜欢
What is the e-commerce conversion rate so abstract?
Xcode13.3.1 项目执行pod install后报错
[CAD drawing Video] AutoCAD 2014 master's way
A full set of excellent SEO tutorials worth 300 yuan [159 lessons]
Shanghai Yuge ASR CAT1 4G module 2-way low power 4G application
Codeworks 5 questions per day (1700 for each)
socke.io長連接實現推送、版本控制、實時活躍用戶量統計
什么是WebRTC?
YYGH-BUG-02
How popular are FB and WhatsApp mass messages in 2022?
随机推荐
Data warehouse: detailed explanation of hierarchical design
使用pytorch和tensorflow计算分类模型的混淆矩阵
[untitled]
Prime mover × Cloud primordial is making sound, reducing cost and increasing efficiency lecture hall
全球国家(和地区)信息JSON数据
Qtcanpool q05: no border
What is the e-commerce conversion rate so abstract?
Comparison between relational database and document database
windows上安装redis并永久修改密码,及ssm框架集成redis
Xcode13.3.1 项目执行pod install后报错
Main functions of 5ggnb and ng ENB
Lenovo hybrid cloud Lenovo xcloud, new enterprise IT service portal
Data middle office: six questions data middle office
1404. 将二进制表示减到1的步骤数
安装 Ffmpefg
Sklearn Feature Engineering (summary)
Mosaic data enhanced mosaic
RL practice (0) - and the platform xinchou winter season [rule based policy]
Enum
使用SQL select count distinct查询语句统计数据库中某个字段的唯一值总数量