首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > JavaScript >

ExtJs代码片断小结

2012-09-07 
ExtJs代码片段小结1.ajax?5.指定精度的四舍五入方法一(推荐)在action中添加// 设置传回的字符串为文本类型

ExtJs代码片段小结

1.ajax

?
5.指定精度的四舍五入

方法一(推荐)在action中添加// 设置传回的字符串为文本类型ServletActionContext.getResponse().setContentType( "text/html;charset=utf-8;");方法二/** * 重写processResponse方法,目的:解决上传页面返回的json字符串中添加了<pre>的字样问题 * @author liaocui * @date 2011-08-18 */Ext.override(Ext.form.Action.Submit,{       // private       processResponse : function(response){           this.response = response;                 if(!response.responseText){               return true;           }else{         //增加下面几句代码就OK啦            ////////////////////////            var data = response.responseText;            if(data.indexOf('<pre>') != -1) {  //限于firefox            response.responseText = data.substring(5, data.length-6);              this.response = Ext.util.JSON.decode(response.responseText);            }                ///////////////////////////          }        this.result = this.handleResponse(response);           return this.result;       }   });  

?
3.临时标题

热点排行