问题描述
环境:前台ext2,后台struts1问题:第一次点查询按钮的时候可以正确获得前20条记录,再点下一页的图标的时候就无法翻页。问题分析:既然第一次后台能正确获取start.limit字段进行分页,前台正确显示,说明后台的接受值部分以及分页sql以及json格式都是没问题的,问题多半在前台ext配置规则等前台代码:<%@pagecontentType="text/html;charset=utf-8"language="java"%><%@pageimport="com.regaltec.ccatstep.common.*"%><%@pageimport="java.util.List"%><%@pageimport="java.text.SimpleDateFormat"%><!DOCTYPEHTMLPUBLIC"-//W3C//DTDHTML4.01Transitional//EN""http://www.w3.org/TR/html4/loose.dtd"><html><head><metahttp-equiv="Content-Type"content="text/html;charset=utf-8"><styletype="text/css">.manualType{color:#FF0000;}</style><title>xxxx</title><%Stringpath=(String)request.getContextPath();StringbasePath=request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";%><linkrel="stylesheet"type="text/css"href="<%=path%>/include/extjs/resources/css/ext-all.css"/><linkrel="stylesheet"type="text/css"href="<%=path%>/include/extjs/resources/css/xtheme-gray.css"/><scriptsrc="<%=path%>/include/extjs/adapter/ext/ext-base.js"></script><scriptsrc="<%=path%>/include/extjs/ext-all.js"></script><scriptsrc="<%=path%>/include/extjs/ext-lang-zh_CN.js"charset="utf-8"></script><scripttype="text/javascript"charset="utf-8">Ext.onReady(function(){varstore=newExt.data.Store({proxy:newExt.data.HttpProxy({url:'<%=path%>/inas2/manager/InasNeCfgStandardCmdAction.do?method=qryNeCfgCmd'}),reader:newExt.data.JsonReader({root:'datas',totalProperty:'totalProperty',fields:['nativeId','nativeName','devName','subIdName','subIdCommand','matchedSet','isCheck']}),remoteSort:false});varcm=newExt.grid.ColumnModel([{header:"命令类别",dataIndex:'subIdName',width:200},{header:"命令标准格式",dataIndex:'subIdCommand',width:260},{header:"命令编码",dataIndex:'matchedSet',width:110,hidden:true},{header:"是否核对",dataIndex:'isCheck',width:80}]);//bydefaultcolumnsaresortablecm.defaultSortable=true;vargrid=newExt.grid.GridPanel({width:document.body.clientWidth,height:480,title:'xxxxxx',store:store,cm:cm,loadMask:true,loadMask:{msg:"正在查询数据..."},bbar:newExt.PagingToolbar({pageSize:20,store:store,displayInfo:true})});//renderitgrid.render('searchResult');varconForm=newExt.FormPanel({title:'核查命令管理',renderTo:"form",items:[{items:[{items:[{id:'nativeId',xtype:'textfield',fieldLabel:'<fontcolor=#E800E8>本地网</font><fontcolor=red>*</font>',name:'nativeId',allowBlank:false,value:'本地网',anchor:'90%'}]}]}],buttons:[{text:'查询',handler:function(){vardeviceType="";vardeviceSubType="";varsubIdName="";varnativeId=encodeURIComponent(document.getElementById('nativeId').value);//varnativeId='F8EB03A0A24CFA493EF9FB9A9FD053F8';alert(nativeId);varisCheck="";store.load({params:{start:0,limit:20,nativeId:nativeId,deviceType:deviceType,deviceSubType:deviceSubType,subIdName:subIdName,isCheck:isCheck}});}}]});});</script></head><body><divid="form"></div><divid="searchResult"></div></body></html>
后台代码:第一次点查询,store.load的时候后台接受的到start、limit的值.再点击下一页图标的时候后台接收不到没有任何反应.
解决方案
解决方案二:
求助,顶起!!!
解决方案三:
把参数写到store组件中。load时不用再传分页的参数
解决方案四:
varstore=newExt.data.Store({proxy:newExt.data.HttpProxy({url:'<%=path%>/inas2/manager/InasNeCfgStandardCmdAction.do?method=qryNeCfgCmd'}),reader:newExt.data.JsonReader({root:'datas',totalProperty:'totalProperty',fields:['nativeId','nativeName','devName','subIdName','subIdCommand','matchedSet','isCheck']}),baseParams:{start:0,limit:10},remoteSort:false});
解决方案五:
至于其他的参数store.baseParams.nativeId=nativeId;store.baseParams.deviceType=deviceType;等等等等然后store.load();
分页的参数这么写也成
解决方案六:
我刚试过了,问题还是一样,求指导,求教育啊....
解决方案七:
后台收不到是什么意思?方法不会被执行?还是参数接收不到?
解决方案八:
引用6楼java_amateur的回复:
后台收不到是什么意思?方法不会被执行?还是参数接收不到?
点击下一页的按钮的时候前台没有将下一页的start,limit参数传递到后台,后台接收不到这两个参数。
解决方案九:
请问楼主解决了吗我也遇到同样的问题