加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

ajax实例

发布时间:2020-12-15 22:02:12 所属栏目:百科 来源:网络整理
导读:@RequestMapping(params = "action=getContractTypes") public @ResponseBody String getContractTypes(HttpServletRequest request,HttpServletResponse response,DraftForm form) { ListConfigObject res = UniflowConfigUtil.getObjectsByName(UniConfigE

@RequestMapping(params = "action=getContractTypes")
public @ResponseBody
String getContractTypes(HttpServletRequest request,HttpServletResponse response,DraftForm form) {
List<ConfigObject> res = UniflowConfigUtil.getObjectsByName(UniConfigEnum.CONTRACT_TYPE.getName());
return res.toString();
// ConfigObject result = null;
// for(ConfigObject cof : res){
// if(cof.getString("name").equals(request.getParameter("contractTypeName"))){
// result = cof;break;
// }
//
// }
// return result==null?"":result.toString();
}

var url = "main/approve/Draft.do?action=getContractTypes";
var subTypeKey = $("#subTypeKey").val()
//alert(url);alert(subTypeKey);alert(dataStr);
$.ajax({
type: "POST",
url: url,
data: dataStr,
success: function(msg){
var types=eval(msg);
$.each(types,function(index1,a){
if(a){
$.each(a.sub,function(index2,b){
if(b.key==subTypeKey){
if(b.products!=undefined){
$table.data("products",b.products);
$tr = $("#"+protoId+"ValueTdTmpl").tmpl(data,{valueId:"",contracts:getContracts(),showDelete:true,rowNum:rowNum,products:b.products});
$table.append($tr);
}else{
hasProducts = false;
}
}
});
}
});
if(!hasProducts){
$table.append("<tr><td colspan='5' style='color:red;text-align:center'>你所选择的业务类型: <b>["+typeName+"]</b> 无需添加标的名称</td></tr>");
}
}

});

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读