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());
    }

  • 相关阅读:
    BEC listen and translation exercise 44
    中译英12
    BEC listen and translation exercise 43
    中译英11
    BEC listen and translation exercise 42
    中译英10
    BEC listen and translation exercise 41
    中译英9
    BEC listen and translation exercise 40
    中译英8
  • 原文地址:https://www.cnblogs.com/kongxc/p/7508831.html
Copyright © 2011-2022 走看看