Flask接口签名sign原理与实例代码浅析
333
2023-04-27
bootstrap实现多个下拉框同时搜索的实例
1、第一个下拉框代码
<#list data.copyfromList as entity>
<#if (entity.type?? && entity.type == '1')>
#if>
#list>
<#list data.copyfromList as entity>
<#if (entity.type?? && entity.type == '7')>
#if>
#list>
<#list data.copyfromList as entity>
<#if (entity.type?? && entity.type == '8')>
#if>
#list>
2、第二个下拉框代码
<#list data.categories as entity>
#list>
3、后台js代码(url 参数整理)
bindEvents:function(){
var self = this, dom = self.element;
$('select[name="copyfrom"]', dom).change(function(event){
self.params.copyfrom = $(this).val();
var url = self.formatParams(self.params);
window.location.href = "cekasp_article.htm" + url;
});
$('select[name="cid"]', dom).change(function(event){
self.params.cid = $(this).val();
var url = self.formatPhttp://arams(self.params);
window.location.href = "cekasp_article.htm" + url;
});
}
formatParams:function(params){
var self = this;
var url = "";
for(var param in params){
if(params[param]){
url += param + "=" + params[param] + "&";
}
}
if(url.length > 0){
url = "?" + url.substring(0,url.length-1);
}
return url;
}
4、后台java部分代码(接收参数,然后过滤器根据参数得到想要的结果)
String categoryId = request.opthttp://String("cid");
if (!ValidateUtil.isNull(categoryId)) {
// 加载栏目信息
JSONObject jsonCategory = toJSONObject(adminService.loadById(CekaspCategory.class, categoryId));
response.put("category", jsonCategory);
param.addFilter("id", FilterType.IN, articleIdList, 1);
}
String copyfrom = request.optString("copyfrom");
if (!ValidateUtil.isNull(copyfrom)) {
param.addFilter("copyfrom", FilterType.EQUALS, copyfrom);
}
List
版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。
发表评论
暂时没有评论,来抢沙发吧~