论坛首页 Web前端技术论坛

Ext.Ajax.request failure options

浏览 4314 次
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
作者 正文
   发表时间:2009-08-26   最后修改:2009-08-26

failure : function(response, options) {

failure有2个参数,第一个是XHR 的response对象,第2个有意思,是Ext.Ajax.request(config)的那个config参数,

于是可以这样实现

Ext.Ajax.request({
								url : '../message.do?method=sendMessage',
								method : 'POST',
								params : {
																		msg : smessage,
																	},
								success : function(response, options) {
																	},
								failure : function(response, options) {
									Ext.Msg.confirm('发送失败  ' + response.status,
											'是否要重新发送', function(btn) {
												if (btn == 'yes') {
                                                    Ext.Ajax.request(options);
												}
											})
								}
							});

 这样的话会一直不停的发送,直到发送成功

   发表时间:2009-08-27  
Extjs Ajax 自动重连的增强 - EXT - web - JavaEye论坛
http://www.iteye.com/topic/398065
0 请登录后投票
论坛首页 Web前端技术版

跳转论坛:
Global site tag (gtag.js) - Google Analytics