zoukankan      html  css  js  c++  java
  • 级联

    //------------------------------javascript---------------------------------------


    <script type="text/javascript">
    $(function() {
    $('#cfgChexiId').change(function(){
    alert("---");
    var dicts = $("#cfgChexiId").val();
    if(""!=dicts){
    $.get("${rootUrl}app/wx/kunlun/choOil/getByParentId?parentId=" + dicts, function(data){
    var msg = eval("(" + data + ")");
    $("#changjiaName").html("<option>请选择</option>");
    for(var i=0,len=msg.length;i<len;i++){
    var op="<option value='"+msg[i].id+"'";
    op+=">"+msg[i].name+"</option>";
    $("#changjiaName").append(op);
    }
    });
    }
    });
    })
    </script>

    //-----------------------------controller---------------------------------------

    @RequestMapping(value = "/wx/kunlun/choOil/getByParentId")
    protected void doGet(@ModelAttribute("queryModel") SystemDataDictModel queryModel,HttpServletRequest req, HttpServletResponse response)
    throws IOException {
    // queryModel.setDictType(Finals.DataDict.valueOf(queryModel.getType()));
    List<SystemDataDict> list = systemDataDictManager.listQuery(queryModel);
    StringBuilder json = new StringBuilder();
    json.append("[");
    if (null != list)
    for (int i = 0; i < list.size(); i++) {
    SystemDataDict systemDataDict = list.get(i);
    if (i == list.size() - 1) {
    json.append("{id:'").append(systemDataDict.getId())
    .append("',name:'").append(systemDataDict.getValue())
    .append("'}");
    } else {
    json.append("{id:'").append(systemDataDict.getId())
    .append("',name:'").append(systemDataDict.getValue())
    .append("'},");
    }
    }
    json.append("]");
    response.getWriter().println(json.toString());
    }

  • 相关阅读:
    [转]OLAP的12条准则
    这几年
    方法论
    用NetHogs监控Linux每个进程的网络使用情况
    Centos下文本文件格式转码解决
    CentOS+Puppet分布式部署Zabbix监控系统
    ubuntu修复grub,u盘引导问题
    postfix搭建纯邮件转发服务器
    Mysql: 利用强制索引去掉重数据
    shell 变量赋值与替换
  • 原文地址:https://www.cnblogs.com/kongxc/p/7508831.html
Copyright © 2011-2022 走看看