Ext 传多个查询条件到后台并接收处理,做关键字查询,怎么做啊,求帮助
展开全部
方法一:post传参
defineCode : defineCode,
code:code
利用EXT自带的ajax
前台js:
Ext.Ajax.request({
url : 'productdefine/entryData/deleteByProductDefineCode.json',
method : 'post',
params : {
defineCode : defineCode,
code:code
},
success : function(response,
options) {
var o = Ext.JSON
.decode(response.responseText);
if (o.map.success) {
grid
.getStore()
.loadPage(
grid
.getStore().currentPage);
}
},
failure : function() {
}
});
后台java,springMVC:
@RequestMapping(value = "/deleteByProductDefineCode")
public ModelAndView deleteByProductDefineCode(
@RequestParam String defineCode,String code) throws Exception {
Map<String, Object> map =this.iNewProductDefineBuiness.deleteByProductDefineCode(defineCode,code);
map.put("success", true);
return new ModelAndView(
"/productdefine/entryData/deleteByProductDefineCode", "map",
map);
}
方法二:get传参
var storeUrl = 'productout/findProLineFlowDayResult.json';
storeUrl = storeUrl + "?startDate=" + sendStartDate + "&endDate="
+ sendEndDate + "&lineNo=" + sendLineCombo;
store.getProxy().url = storeUrl;
store.load();
store定义
var store = Ext.create('Ext.data.Store', {
model : 'Module.production.ProLineFlowDayResult',
proxy : {
type : 'ajax',
url : 'productout/findProLineFlowDayResult.json',
reader : {
type : 'json',
root : 'map.result',
totalProperty : 'map.totalCount'
}
}
});
java,springmvc后台
@RequestMapping(value = "/findProLineFlowDayResult")
public ModelAndView findProLineFlowDayResult(String line, String startDate,
String endDate, String lineNo, HttpServletRequest request)
throws Exception {
SysOpers oper = (SysOpers) request.getSession().getAttribute(
"logonOper");
String operId = oper.getOperId();
Map<String, Object> map = new HashMap<String, Object>();
List<Map<String, Object>> list = this.iProductOutputBusiness
.findProLineFlowDayResult(startDate, endDate, lineNo, operId);
map.put("result", list);
map.put("totalCount", list.size());
map.put("success", true);
map.put("msg", "");
return new ModelAndView("productout/findProLineFlowDayResult", "map",
map);
}
追问
已经写好了,不过还是谢谢你了
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询