easyui datagrid combobox通过url获取json数据的下拉框
来源:互联网 发布:原生js设置transform 编辑:程序博客网 时间:2024/05/16 07:05
------前台部分------------
<th align="left" width="12%" data-options="field:'relationtype',
formatter: function(value,row){
var dicname;
$.ajax( //这是选中后返回的名称,没有这一步就会出现,选中离开后,还是原来的名称。
{
type: 'post',
url: '${path }/tfieldTypeAction!getDICName.do',
data: 'dicValue='+value,
async:false, //必须,不然外部js无法获取内容
dataType: 'text',
success: function (result) {
dicname=result;
},
error: function (err) {
alert('error'+err);
return false;
}
});
return dicname;
},
editor:{
type:'combobox',
options:{
valueField:'value',
textField:'name',
url:'${path }/tfieldTypeAction!getrelationtypeByMarkDCList.do',
editable:false,
required:true}
}">数据关联</th>
------后台json部分-------
//json
public void getrelationtypeByMarkDCList()
{
try {
HttpServletResponse response = ServletActionContext.getResponse();
response.setContentType("application/json");
response.setCharacterEncoding("UTF-8");
try {
creditRelationTypeList = wfDataDicImpl.getByMarkDCList(DictionaryID.RELATION_TYPE);
jsonArray = JSONArray.fromObject( creditRelationTypeList );
} catch (Exception e) {
e.printStackTrace();
}
response.getWriter().write(jsonArray.toString());// 返回json类型对象
response.getWriter().close();
} catch (IOException e) {
e.printStackTrace();
}
}
/**
* 根据字段value查询name
*/
public void getDICName()
{
String dicname="";
HttpServletResponse response = ServletActionContext.getResponse();
response.setContentType("application/json");
response.setCharacterEncoding("UTF-8");
try {
if (!StringUtils.isEmptyOrNull(dicValue)) {
List<WfDataDic> wfdatadiclist = wfDataDicImpl
.getByMarkDCList(DictionaryID.RELATION_TYPE);
for (WfDataDic wfDataDic : wfdatadiclist) {
if (dicValue.equals(wfDataDic.getValue())) {
dicname=wfDataDic.getName();
}
}
response.getWriter().write(dicname);
response.getWriter().close();
}
} catch (IOException e) {
e.printStackTrace();
}catch (Exception e) {
e.printStackTrace();
}
}
--------获取节点部分-------
if(!StringUtils.isEmptyOrNull(lc.getRelationtype()))
{
sb.append("\"relationtype\":\""+lc.getRelationtype()).append("\",");
/*for (WfDataDic wfDataDic : wdclist) {
if(lc.getRelationtype().equals(wfDataDic.getValue()))
{
sb.append("\"name\":\""+wfDataDic.getName()).append("\",");
}
}*/
}
- easyui datagrid combobox通过url获取json数据的下拉框
- easyui datagrid combobox下拉框获取数据问题
- easyui-combobox 下拉列表的JSON获取数据例子
- easyUI下拉框控件easyui-combobox使用后台json文件填充数据失败的问题
- EasyUI里的DataGrid Editable combobox下拉框联动
- easyui在datagrid的toolbar中添加下拉框combobox
- easyui-combobox 获取下拉框中的所有数据
- easyUI(六) -- combobox实现下拉框及其值的获取
- easyUI中combobox的下拉框数据背景颜色设置
- EasyUI中datagrid获取json数据遇到的问题
- 通过url获取Json格式的数据
- 在Easyui-datagrid嵌入下拉框(combobox)
- easyui datagrid 的数据加载Json数据
- 如想给一个easyui的combobox组件在获取json数据之前添加数据
- EasyUi的ComboBox(下拉列表框)
- easyui combobox下拉框省市县三级联动(从数据库获取数据)
- ComboBox(下拉列表框)通过url加载调用远程数据
- EasyUI DataGrid绑定嵌套的json数据
- android 移植 ffmpeg (一)
- IOS的基本控件的使用-UIWindow对象
- poj 2785 4 Values whose Sum is 0(二分)
- vs2008 web创作组件安装失败
- zabbix 默认item采集使用被动模式 需要改为主动模式
- easyui datagrid combobox通过url获取json数据的下拉框
- SSH 端口映射
- Centos7下安装mongodb数据库
- Leetcode-136. Single Number
- 虚云法师:《金刚经》的总骨
- IOS 截获html并修改便签内容(包括修改网页图片大小)
- 整理些前端高评价必备书籍
- this关键字
- 设置Linux环境变量的方法和区别_Ubuntu