Js结合struts回显select代码示例
来源:互联网 发布:苹果电脑图片编辑软件 编辑:程序博客网 时间:2024/06/03 20:27
// 初始化内容
function createSelect(position_id,dict_type_code,selectedId){
alert(selectedId);
var $select = $("<select></select>");
$select.append("<option>---------请选择---------</option>");
$("#"+position_id).append($select);
$.post("${pageContext.request.contextPath}/BaseDictAction", { "dict_type_code": dict_type_code },
function(json){
$.each( json, function(i, json){
var $option = $("<option>"+json["dict_item_name"]+"</option>");
if(json['dict_id'] == selectedId){
//判断是否需要回显 ,如果需要使其被选中
$option.attr("selected","selected");
}
$select.append($option);
});
}, "json");
function createSelect(position_id,dict_type_code,selectedId){
alert(selectedId);
var $select = $("<select></select>");
$select.append("<option>---------请选择---------</option>");
$("#"+position_id).append($select);
$.post("${pageContext.request.contextPath}/BaseDictAction", { "dict_type_code": dict_type_code },
function(json){
$.each( json, function(i, json){
var $option = $("<option>"+json["dict_item_name"]+"</option>");
if(json['dict_id'] == selectedId){
//判断是否需要回显 ,如果需要使其被选中
$option.attr("selected","selected");
}
$select.append($option);
});
}, "json");
}
写之前明确需要知道的内容:1添加select的位置
2需要查询的内容
3回显内容如何确定
阅读全文
0 0
- Js结合struts回显select代码示例
- select模型 示例代码
- javabean的妙用-eclipse结合hibernate插件、struts插件快速生成源代码(示例代码)
- select模型的示例代码
- js表单结合struts上传文件
- JS分页代码示例
- js 300代码示例
- select 选中的js代码
- select控件获取text值示例代码
- Struts 示例代码,改改就用
- 【Struts】:Struts1简介及第一个代码示例
- JFreeChart在struts中的示例代码
- html中select结合js的使用简介
- JS操作cookies示例代码
- JS获取对象代码示例
- JS正则表达式示例代码
- JS回车处理代码示例
- css结合js制作下拉菜单代码
- Apache服务器的管理
- lcs、lss
- 正则表达式re笔记
- opencv findContour函数
- 面向对象
- Js结合struts回显select代码示例
- Webpck&React,redux学习
- HDU 4427 Math Magic (优化DP,ICPC2012长春)
- Anaconda "failed to start because it could not find or load the Qt platform plugin"
- vijos1094(差分约束系统)
- python3 简单实现 web 静态服务器
- 删除shared包
- Tomcat 7 快速入门及应用
- Python中多线程和单线程端口扫描对比