现在的位置: 首页 > 综合 > 正文

Extjs 解决乱码

2014年03月19日 ⁄ 综合 ⁄ 共 823字 ⁄ 字号 评论关闭

js主要是使用  {name : encodeURIComponent(value)}  

java接受主要是 java.net.URLDecoder.decode(name, "utf-8"); 

ajax传参乱码

              infoStore.on("beforeload",function(){
			var newParams={
					certification:encodeURIComponent(certificationName)
			};
			Ext.apply(infoStore.proxy.extraParams,newParams);
		});
		infoStore.load({
	   		  params:{
	   		    start: 0,
	   		    limit: itemsPerPage
	   		  } 
	   	 }); 

form表单

   var username=myForm.getForm().findField("username").getValue();
   var info=myForm.getForm().findField("info").getValue();
   if(!Ext.isEmpty(username))
     myForm.getForm().findField("username").setValue(encodeURIComponent(batName));
   if(!Ext.isEmpty(info))
     myForm.getForm().findField("info").setValue(encodeURIComponent(userName))
   myForm.getForm().submit({
     success : function(form, action) {
        Ext.Msg.alert(""信息"", action.result.msg); 
     },
     failure : function() {
       Ext.Msg.alert(""错误"", ""体系失足,批改失败!"");
     }
  });

但是对于大量的form表单,总共不至于每个都这样,没不知道怎么解决

抱歉!评论已关闭.